例如,你可以使用scatter方法的其他参数来改变点的颜色、大小和形状,或者使用plot方法来绘制三维线条和曲面。你还可以使用其他Matplotlib的功能来进一步美化你的图形,例如添加图例、调整轴的范围等。希望这个简单的例子能帮助你开始使用Python的mpl_toolkits.mplot3d工具包绘制三维图形。如果你有任何问题或需要进一步
现在使用mpl_toolkits中的Axes3D来绘制散点图: importmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3D fig=plt.figure()ax=fig.add_subplot(111,projection='3d')# 绘制散点图ax.scatter(x,y,z)# 设置标签ax.set_xlabel('X Label')ax.set_ylabel('Y Label')ax.set_zlabel('Z Label')ax.se...
importnumpyasnpimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3D# 生成随机数据np.random.seed(0)temperature=np.random.randint(10,35,size=100)humidity=np.random.randint(20,100,size=100)wind_speed=np.random.uniform(0,15,size=100)# 创建3D散点图fig=plt.figure()ax=fig.add_subplot(...