The convex hull of a set of 2D points is the set of points that form a convex polygon enclosing all the remaining points. I needed an implementation of this algorithm for some of my research work, and a quick Google search found a convex hull implementation for Python that works very well. It generated the image below. In addition, I found a great interactive demonstration of some convex hull algorithms.