scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
convex_hull_plot_2d(hull, ax=None)

Notes

Requires Matplotlib.

Parameters

hull : scipy.spatial.ConvexHull instance

Convex hull to plot

ax : matplotlib.axes.Axes instance, optional

Axes to plot on

Returns

fig : matplotlib.figure.Figure instance

Figure for the plot

Plot the given convex hull diagram in 2-D

See Also

ConvexHull

Examples

>>> import matplotlib.pyplot as plt
... from scipy.spatial import ConvexHull, convex_hull_plot_2d

The convex hull of a random set of points:

>>> rng = np.random.default_rng()
... points = rng.random((30, 2))
... hull = ConvexHull(points)

Plot it:

>>> _ = convex_hull_plot_2d(hull)
... plt.show()
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.spatial._qhull.ConvexHull scipy.spatial._plotutils.convex_hull_plot_2d

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/spatial/_plotutils.py#92
type: <class 'function'>
Commit: