I am trying to plot some 3d point cloud with mayavi like so
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()
When playing with scale_factor, the balls which represent each plotted point vary in size.
I would like to know/determine that size.
I have no idea what "5.0" actually means.
How can this be done?
From the official 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
If you add mlb.axes()
before mlb.show()
it should make more sense.
You should pass the variable that is used for scaling explicitly as fourth parameter s
to points3d(x, y, z, s, ...)
.
We don't know what your *their_points[:, 0, :].T
does and which shape and dimension it has, but this could for sure mess up the scaling if the wrong dimension is chosen. Try to slice x, y, z, s
and pass them explicitly.