填充轮廓#

Axes3D.contourfAxes3D.contour 的不同之处在于它创建填充轮廓,即使用离散数量的颜色来对域进行着色.

这就像 2D 中的 Axes.contourf 图,除了对应于水平 c 的阴影区域在平面 z=c 上绘制.

import matplotlib.pyplot as plt

from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d

ax = plt.figure().add_subplot(projection='3d')
X, Y, Z = axes3d.get_test_data(0.05)
ax.contourf(X, Y, Z, cmap=cm.coolwarm)

plt.show()
contourf3d

标签: plot-type: 3D level: beginner

Gallery generated by Sphinx-Gallery