title: How do I add a scale bar to a plot in Mayavi2/VTK?
body: <p>I would like to add a scale bar (showing how big a micron is for example) to a mayavi plot I create with mlab. </p>
  
  <p>For example, referencing this question: <a href="https://stackoverflow.com/questions/6076827/how-to-display-a-volume-with-non-cubic-voxels-correctly-in-mayavi">How to display a volume with non-cubic voxels correctly in mayavi</a></p>
  
  <p>I can set the voxel size of a plot by using</p>
  
  <pre><code>from enthought.mayavi import mlab
  import numpy as 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()
  </code></pre>
  
  <p>I would like an automated way of adding a some indicator of what the scale of the object I am showing is. Right now I am adding scale bars by hand with inkscape to exported images, but there has to be a better way. </p>
  
  <p>A straightforward mayavi way would be most helpful, but if there is anything in vtk that would do it, I can always use mayavi's wrapper. </p>
  
  <p>Something like text3d will let me add text, and then I suppose I could figure out how to draw a line as well and compute the correct scaling by hand, but I am hoping there is an easier way.  </p>