@@ -470,7 +470,7 @@ def point_position(self, su, sv, sl, resolution=0.01, return_extent=True):
470
470
else :
471
471
return pos
472
472
473
- def mplot_surface (self , ures = 8 , vres = 8 , ** kwargs ):
473
+ def mplot_surface (self , ures = 8 , vres = 8 , figax = False , ** kwargs ):
474
474
"""Plot the enclosing surfaces of the volume using Mayavi's `mesh()` function
475
475
476
476
Parameters
@@ -514,13 +514,18 @@ def mplot_surface(self, ures=8, vres=8, **kwargs):
514
514
meshpts1 = self .ev (hru , hrv , np .max (self .l ))
515
515
meshpts2 = self .ev (hru , hrv , np .min (self .l ))
516
516
517
- m1 = mlab .mesh (* meshpts1 , ** kwargs )
518
- m2 = mlab .mesh (* meshpts2 , ** kwargs )
517
+ if figax is None :
518
+ m1 = mlab .mesh (* meshpts1 , ** kwargs )
519
+ m2 = mlab .mesh (* meshpts2 , ** kwargs )
519
520
520
- # Turn off perspective
521
- fig = mlab .gcf ()
522
- fig .scene .camera .trait_set (parallel_projection = 1 )
523
- return fig
521
+ # Turn off perspective
522
+ fig = mlab .gcf ()
523
+ fig .scene .camera .trait_set (parallel_projection = 1 )
524
+ return fig
525
+ else :
526
+ fig , ax = figax
527
+ m1 = ax .plot_surface (* meshpts1 , ** kwargs )
528
+ m2 = ax .plot_surface (* meshpts2 , ** kwargs )
524
529
525
530
def mplot_volume (self , ures = 8 , vres = 8 , ** kwargs ):
526
531
"""Plot the volume using Mayavi's `scalar_scatter()` function
0 commit comments