//引入必要的库 import matplotlib.pyplot as plt import numpy as np //绘制一个简单的三维图表 # 创建数据 x = np.linspace(-5, 5, 100) y = np.linspace(-5, 5, 100) X, Y = np.meshgrid(x, y) Z = np.sin(np.sqrt(X**2 + Y**2)) # 绘制图表 fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.plot_surface(X, Y, Z) ax.set_xlabel('x轴') ax.set_ylabel('y轴') ax.set_zlabel('z轴') ax.set_title('三维图表示例') plt.show()