4

I have data that essentially looks like that: (minimum working example)

import mayavi.mlab as mlab
pts = mlab.points3d([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,500], [1,2,3,4,100])
mlab.show()

And this already shows my problem: because of the huge outlier in z, the other points are barely visible. In the visualized result, the z axis is multiple times larger than the x/y axis. Now, let's disregard that I have the same problem for size (matplotlib let's you neatly define size as s^2 in points, where I didn't have this problem), is there a way to get a plot with a neat aspect ratio that isn't essentially just a line?

I know about the extent parameter to enforce a square plot ([0,1,0,1,0,1]) but this squashes/distorts all drawn elements and turns my spheres into flat puddles of dye. I cannot use mode = 'point' to prevent the distortion of extent because the size of each data point is relevant.

I'm coming from matplotlib because multiple occlusion problems with mplot3d made it impossible to use the plot result. However, in matplotlib not only is a neatly autoscaled aspect ratio default, it is trivial to change the aspect ratio without distorting the drawn elements. It is also simple to limit axis ranges by hand if necessary.

Is there any way to do any of this in mayavi.mlab? I really don't want to "simulate" this by scaling the data because this will lead to new trouble with axis labels etc.

Julian
  • 299
  • 2
  • 15
  • Related: https://stackoverflow.com/questions/13015097/how-do-i-scale-the-x-and-y-axes-in-mayavi2 – sedot Sep 14 '18 at 19:26

0 Answers0