绘制三维图
1 import matplotlib.pyplot as plt 2 #导入3D包 3 from mpl_toolkits.mplot3d import Axes3D 4 #创建X、Y、Z坐标 5 X=[1,1,2,2] 6 Y=[3,4,4,3] 7 Z=[1,100,1,1] 8 fig = plt.figure() 9 # 创建了一个Axes3D的子图放到figure画布里面 10 ax = Axes3D(fig) 11 ax.plot_trisurf(X, Y, Z) 12 plt.show()
![](https://img2020.cnblogs.com/blog/1981035/202004/1981035-20200407214338475-1750936264.png)
正是江南好风景