绘制三维图

 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()

 

 

 

posted @ 2020-04-07 21:44  小他_W  阅读(200)  评论(0编辑  收藏  举报