from matplotlib import pyplot as plt
def draw_3d_p(ps):
'''input list 3d p'''
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x, y, z = zip(*ps)
ax.scatter(x, y, z,c='red')
for i, (xi, yi, zi) in enumerate(ps):
ax.text(xi, yi, zi, str(i), size=10, zorder=1)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
ax.set_aspect('equal')
# 显示图形
plt.show()
matplotlib 输入3d点的list 在空间中展现出来 代码打包
于 2025-03-13 16:07:51 首次发布