This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / spatial / _plotutils / convex_hull_plot_2d

function

scipy.spatial._plotutils:convex_hull_plot_2d

source: build-install/usr/lib/python3.14/site-packages/scipy/spatial/_plotutils.py:81

Signature

def convex_hull_plot_2d(hull, ax = None)

Summary

Plot the given convex hull diagram in 2-D.

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

Notes

Requires Matplotlib.

Array API Standard Support

convex_hull_plot_2d is not in-scope for support of Python Array API Standard compatible backends other than NumPy.

See dev-arrayapi for more information.

Examples

import numpy as np
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()
✓
fig-e0cd1910e2e0aa51.png

See also

ConvexHull

Aliases

  • scipy.spatial.convex_hull_plot_2d

Referenced by

This package