python - How do I add a scale bar to a plot in Mayavi2/VTK? -



python - How do I add a scale bar to a plot in Mayavi2/VTK? -

i add together scale bar (showing how big micron example) mayavi plot create mlab.

for example, referencing question: how display volume non-cubic voxels correctly in mayavi

i can set voxel size of plot using

from enthought.mayavi import mlab import numpy np s=64 x,y,z = np.ogrid[0:s,0:s,0:s/2] volume = np.sqrt((x-s/2)**2 + (y-s/2)**2 + (2*z-s/2)**2) grid = mlab.pipeline.scalar_field(data) grid.spacing = [1.0, 1.0, 2.0] contours = mlab.pipeline.contour_surface(grid, contours=[5,15,25], transparent=true) mlab.show()

i automated way of adding indicator of scale of object showing is. right adding scale bars hand inkscape exported images, there has improve way.

a straightforward mayavi way helpful, if there in vtk it, can utilize mayavi's wrapper.

something text3d allow me add together text, , suppose figure out how draw line , compute right scaling hand, hoping there easier way.

try following:

mlab.axes() mlab.outline() mlab.colorbar()

this reference: http://github.enthought.com/mayavi/mayavi/auto/mlab_reference.html help several examples.

python scipy vtk mayavi

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -