如何知道mayavi打印的球的大小?
How to know the size of balls printed by mayavi?
我正在尝试像这样用 mayavi 绘制一些 3d 点云
mlb.figure(bgcolor=(0,0,0))
mlb.points3d(*my_points[:, 0, :].T, scale_factor=5.0, color=(1,0,0))
mlb.points3d(*their_points[:, 0, :].T, scale_factor=5.0, color=(0,1,0))
mlb.show()
玩scale_factor时,代表每个标绘点的球大小不同。
我想要know/determine那个尺码。
我不知道“5.0”到底是什么意思。
如何做到这一点?
来自官方documentation to points3d:
scale_factor: The scaling applied to the glyphs. the size of the glyph
is by default calculated from the inter-glyph spacing. Specify a float
to give the maximum glyph size in drawing units
如果在 mlb.show()
之前添加 mlb.axes()
应该更有意义。
您应该将用于缩放的变量显式地作为第四个参数 s
传递给 points3d(x, y, z, s, ...)
。
我们不知道您的 *their_points[:, 0, :].T
是做什么的,也不知道它的形状和尺寸,但如果选择了错误的尺寸,这肯定会弄乱缩放比例。尝试切片 x, y, z, s
并显式传递它们。
我正在尝试像这样用 mayavi 绘制一些 3d 点云
mlb.figure(bgcolor=(0,0,0))
mlb.points3d(*my_points[:, 0, :].T, scale_factor=5.0, color=(1,0,0))
mlb.points3d(*their_points[:, 0, :].T, scale_factor=5.0, color=(0,1,0))
mlb.show()
玩scale_factor时,代表每个标绘点的球大小不同。
我想要know/determine那个尺码。
我不知道“5.0”到底是什么意思。
如何做到这一点?
来自官方documentation to points3d:
scale_factor: The scaling applied to the glyphs. the size of the glyph is by default calculated from the inter-glyph spacing. Specify a float to give the maximum glyph size in drawing units
如果在 mlb.show()
之前添加 mlb.axes()
应该更有意义。
您应该将用于缩放的变量显式地作为第四个参数 s
传递给 points3d(x, y, z, s, ...)
。
我们不知道您的 *their_points[:, 0, :].T
是做什么的,也不知道它的形状和尺寸,但如果选择了错误的尺寸,这肯定会弄乱缩放比例。尝试切片 x, y, z, s
并显式传递它们。