{ } Raw JSON

bundles / scipy 1.17.1 / scipy / spatial / _plotutils / delaunay_plot_2d

function

scipy.spatial._plotutils:delaunay_plot_2d

source: /scipy/spatial/_plotutils.py :20

Signature

def   delaunay_plot_2d ( tri ax = None )

Summary

Plot the given Delaunay triangulation in 2-D

Parameters

tri : scipy.spatial.Delaunay instance

Triangulation 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.

Examples

import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Delaunay, delaunay_plot_2d
The Delaunay triangulation of a set of random points:
rng = np.random.default_rng()
points = rng.random((30, 2))
tri = Delaunay(points)
Plot it:
_ = delaunay_plot_2d(tri)
plt.show()
fig-2b7acd1e4a2de560.png

See also

Delaunay
matplotlib.pyplot.triplot

Aliases

  • scipy.spatial.delaunay_plot_2d