【发布时间】:2018-10-12 08:58:07
【问题描述】:
我有一个点云,为了展示它,我使用了matpyplot 库。然后我想在这个图中添加一个点,它是那个云的质心。这是我的代码
point_list, centroid_list = points(dataset[:, :7])
# take one point cloud
points = np.array(point_list[0])
# take the centroid of that point cloud
centroid = np.array(centroid_list[0])
f = plt.figure(figsize=(15, 8))
ax = f.add_subplot(111, projection='3d')
ax.scatter(*np.transpose(points[:, [0, 1, 2]]), s=1, c='#FF0000', cmap='gray')
ax.plot(centroid, 'or') # this line doesn't work
plt.show()
画点云的线是我的问题,不知道怎么加点。我在其他线程中尝试了一些解决方案,但它们不起作用。我想用另一种颜色绘制质心,也许更大,例如使用散点图的符号s=5, c='#00FF00'。
【问题讨论】:
标签: python matplotlib plot point-clouds centroid