绘制三维图

Posted monsterhy123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了绘制三维图相关的知识,希望对你有一定的参考价值。

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

技术图片

 

 

 

以上是关于绘制三维图的主要内容,如果未能解决你的问题,请参考以下文章