Python三维绘图——Matplotlib

1.创建三维坐标轴对象Axes3D
方法一、利用关键字“projection=3D”来实现

#方法一、利用关键字”objection=3d“
from matplotlib import pyplot as plt
 
#定义坐标轴
fig=plt.figure()
ax1=plt.axes(projection='3d')
方法二、利用三维轴通过从mpl_toolkits.mplot3d导入 Axes3D

#方法二、利用三维轴
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
 
#定义图像和三维格式坐标轴
fig=plt.figure()
ax2=Axes3D(fig)
2.三维曲线和散点
————————————————
版权声明:本文为CSDN博主「Lois_llw」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Lois_llw/article/details/122408596

文章评论

  加载评论内容,请稍等......