绘制 3D 轮廓(水平)曲线#

这就像 2D 中的轮廓图,除了 f(x, y)=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.contour(X, Y, Z, cmap=cm.coolwarm)  # Plot contour curves

plt.show()
contour3d

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

Gallery generated by Sphinx-Gallery