enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.28k stars 282 forks source link

Barchart: Separate scales for X- and Y #1257

Open nVentis opened 1 year ago

nVentis commented 1 year ago

In order to allow easier plotting of 3D-histograms using barcharts in mayavi, it would be great to have a possibility for glyphs to have different scaling values in X- and Y-directions. This would especially allow using the integrated axes labelling, as bars with widths of 1 in X- and Y-direction are not often the case. At the moment, I have to recreate labelling manually.

The easiest approach might be just to add a new vector parameter to the barchart function, e.g. scale_components (with the scales in X,Y,Z-directions), which can be directly passed to VTK when setting ScaleMode to VTK_SCALE_BY_VECTORCOMPONENTS

See also here: https://github.com/Kitware/VTK/blob/897333f931a4f2813b0be37ec8cf6ad919e629d9/Filters/Core/vtkGlyph3D.cxx#L475