@@ -64,16 +64,16 @@ def savefig(self, num):
6464 print ('*** Saving %s' % (fout ))
6565 plt .savefig (fout , ** self .kw_savefig )
6666
67- def plot_inputs (self ):
67+ def plot_inputs (self , mesh = False , boundaries = False ):
6868 self .set_inputs ()
69- ax1 , ax2 = self .newfig (mesh = False , boundaries = False , floating = False )
69+ ax1 , ax2 = self .newfig (mesh = mesh , boundaries = boundaries , floating = False )
7070 self .plot_boundaries (ax1 )
7171 self .plot_boundaries (ax2 , hidelegend = True )
7272 self .plot_velocities (ax1 , kw_cb = self .kw_vel ['kw_cb' ], kw_tcf = self .kw_vel ['kw_tcf' ], kw_cax = self .kw_cax )
7373 self .plot_strainratemag (ax2 , kw_cb = self .kw_epsE ['kw_cb' ], kw_tcf = self .kw_epsE ['kw_tcf' ], kw_cax = self .kw_cax )
7474 self .savefig (0 )
75-
76- def plot_results (self , problem , numerics ):
75+
76+ def plot_results (self , problem , numerics , savefig = True ):
7777 self .set_inputs ()
7878 self .set_solution (problem ['name' ])
7979 ax1 , ax2 = self .newfig (mesh = False , boundaries = False , floating = False )
@@ -90,7 +90,8 @@ def plot_results(self, problem, numerics):
9090 if problem ['name' ] == 'LROT' : num = 1
9191 if problem ['name' ] == 'LROT+DDRX' : num = 2
9292 if problem ['name' ] == 'altbc' : num = 3
93- self .savefig (num )
93+ if savefig : self .savefig (num )
94+ return (ax1 ,ax2 )
9495
9596 def plot_biases (self , problem ):
9697 self .set_inputs ()
@@ -125,7 +126,7 @@ def plot_CPOs(self, ax, fab, onlymarkers=False, lvlmax=0.4, ROTATE_TO_XY=True, d
125126
126127 ###########
127128
128- def plot_boundaries (self , ax , lw = 2 , zorder = 20 , hidelegend = False ):
129+ def plot_boundaries (self , ax , lw = 2 , zorder = 20 , ncol = 3 , hidelegend = False ):
129130 xb , yb = self .xyboundaries ()
130131 legh , legl = [], []
131132 for ii in range (2 ):
@@ -136,7 +137,7 @@ def plot_boundaries(self, ax, lw=2, zorder=20, hidelegend=False):
136137 legh .append (Line2D ([0 ], [0 ], color = self .c_floating , lw = lw ))
137138 legl .append ('Floating' )
138139 if not hidelegend :
139- ax .legend (legh , legl , loc = 'upper left' , ncol = 3 , fancybox = False , frameon = False , ** self .kw_leg )
140+ ax .legend (legh , legl , loc = 'upper left' , ncol = ncol , fancybox = False , frameon = False , ** self .kw_leg )
140141
141142 def xyboundaries (self ):
142143 (coords , bmeshes ) = self .bmesh ()
0 commit comments