例2.57 画出三维表面图
点击查看代码
import pylab as plt
import numpy as np
ax=plt.axes(projection='3d')
X = np.arange(-6, 6, 0.25)
Y = np.arange(-6, 6, 0.25)
X, Y = np.meshgrid(X, Y)
Z = np.sin(np.sqrt(X**2 + Y**2))
surf = ax.plot_surface(X, Y, Z, cmap='coolwarm')
plt.colorbar(surf); plt.show()
print("学号:2023310143004")