scipy.spatial.delaunay_plot_2d¶
- scipy.spatial.delaunay_plot_2d(tri, ax=None)¶
在二维中绘制给定的Delaunay三角剖分
- 参数
- triscipy.spatial.Delaunay实例
要打印的三角剖分
- axmatplotlib.axes.Axy实例,可选
要在其上打印的轴
- 退货
- figmatplotlib.figure.Figure实例
用于绘图的插图
注意事项
需要Matplotlib。
示例
>>> import matplotlib.pyplot as plt >>> from scipy.spatial import Delaunay, delaunay_plot_2d
一组随机点的Delaunay三角剖分:
>>> rng = np.random.default_rng() >>> points = rng.random((30, 2)) >>> tri = Delaunay(points)
绘制它:
>>> _ = delaunay_plot_2d(tri) >>> plt.show()