0

This is just a small question. I use the sentence below to control the three axes ranges.

mlab.axes(xlabel='x', ylabel='y', zlabel='z',ranges=(0,10000,0,10000,0,22),nb_labels=10)

In fact the real data ranges are (3000,4000),(5000,6000),(0,22) respectively. However the axes of the figure I plot is scaled to (0,10000,0,10000,0,22).

I did not find a parameter of mlab.axes can control that.

Do I have to calculate the data ranges every time? Without knowing the real data range, is there a way to make the axis range obey the real data?

Community
  • 1
  • 1
questionhang
  • 735
  • 2
  • 12
  • 31
  • I'm not sure I fully understand what you're asking here or how to fix the problem that I think you're asking, but why can't you get the extent from the real data, even if you didn't generate it? You could do this in principle even if you only have some tvtk surfaces that a black box passes you. – aestrivex Nov 25 '13 at 19:43
  • it seems there is not a direct way to do that really. http://stackoverflow.com/questions/13015097/how-do-i-scale-the-x-and-y-axes-in-mayavi2 – questionhang Nov 26 '13 at 01:28
  • 1
    It is unwieldy, but you could always grab the ranges by `np.max(surf.mlab_source.x)` and so on. You could implement the automated scaling specific to your app by listening for the data changes you are interested in on `mlab_source` – aestrivex Nov 26 '13 at 15:10

0 Answers0