0

Is there a way of a procedure similar to plt.gca() to get a handle to the current axes. I first do a=mlab.surf(x, y, u2,warp_scale='auto')

and then

b=mlab.plot3d(yy, yy, (yy-40)**2 ,tube_radius=20.0)

but the origin of a and b are different and the plot looks incorrect. So I want to put b into the axes of a

In short, what would be the best way in mayavi to draw a surface and a line on same axes?

Community
  • 1
  • 1
Sleepyhead
  • 1,009
  • 1
  • 10
  • 27

2 Answers2

1

What you are expecting to be able to do from your matplotlib experience is not how mayavi axes work. In matplotlib the visualization is a child of the axes and the axes determines its coordinates. In mayavi or vtk, visualization sources consist of points in space. Axes are objects that surround a source and provide tick markings of the coordinate extent of those objects, that are not necessary for the visualizations, and where they exist they are children of sources.

aestrivex
  • 5,170
  • 2
  • 27
  • 44
0

You should remove the argument warp_scale='auto'

a=mlab.surf(x, y, u2)

and it will work.