# 导入库
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()