I'd like to know how to plot many cubes with Python. For each cube I have its coordinates (Xmin, Xmax, Ymin, Ymax, Zmin, Zmax) and its value to draw the cube according this value. In fact what I really want to draw voxels.
I've seen some libraries like matplotlib, mayavi, OpenGL, but I don't know which of these libraries to use and how. I think it's not difficult because a cube is an easy regular figure, but I can't reach the solution.
As I have to plot many cubes, it would be good to set the extent, not to represent all the cubes, and I know that mayavi has this option.
In mayavi, you can use set the glyph type from a list of predefined shapes with
mlab.points3d
.This will plot the cube at each point, at the center of the cube.
You can also plot glyphs and then later change the source type with
(You can also do this in the pipeline menu)
The
scale_factor
argument will allow you to change the cube size.It's an inconvenient way to plot voxel by voxel data, but it will do what you asked for.