# 导入库
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# 开始绘图
fig = plt.figure()
ax = Axes3D(fig)
x = data[:, 0]
y = data[:, 1]
z = data[:, 2]
ax.scatter(x,y,z)
# 保存图片 显示图片
plt.savefig('the figure named {}'.format(str), format='png', dpi=300, pad_inches=0)
plt.show()
python中利用matplotlib绘制三维散点图 Axes3D
最新推荐文章于 2024-07-02 17:36:49 发布