In [7]:
import numpy
import scipy.spatial
import toyplot
In [18]:
numpy.random.seed(1234)
points = numpy.random.random((30, 2))
hull = scipy.spatial.ConvexHull(points)
hull_points = numpy.concatenate((hull.vertices, hull.vertices[:1]))
canvas = toyplot.Canvas()
axes = canvas.axes()
axes.plot(points[hull_points,0], points[hull_points,1], style={"stroke":"yellow", "stroke-width":50, "fill":"yellow","opacity":0.5})
axes.scatterplot(points[:,0], points[:,1])
Out[18]:
In [ ]: