@@ -125,6 +125,9 @@ def _valid_plot_kwargs():
125
125
'block' : { 'Default' : True ,
126
126
'Validator' : lambda value : isinstance (value ,bool ) },
127
127
128
+ 'returnfig' : { 'Default' : False ,
129
+ 'Validator' : lambda value : isinstance (value ,bool ) },
130
+
128
131
}
129
132
130
133
_validate_vkwargs_dict (vkwargs )
@@ -476,22 +479,29 @@ def plot( data, **kwargs ):
476
479
if not used_ax4 and ax4 is not None :
477
480
ax4 .get_yaxis ().set_visible (False )
478
481
482
+ if config ['returnfig' ]:
483
+ axlist = [ax1 , ax3 ]
484
+ if ax2 : axlist .append (ax2 )
485
+ if ax4 : axlist .append (ax4 )
486
+
479
487
if config ['savefig' ] is not None :
480
488
save = config ['savefig' ]
481
489
if isinstance (save ,dict ):
482
490
plt .savefig (** save )
483
491
else :
484
492
plt .savefig (save )
485
- else :
493
+ elif not config [ 'returnfig' ] :
486
494
# https://stackoverflow.com/a/13361748/1639359 suggests plt.show(block=False)
487
495
plt .show (block = config ['block' ])
496
+
497
+ if config ['returnfig' ]:
498
+ return (fig , axlist )
488
499
489
500
# rcp = copy.deepcopy(plt.rcParams)
490
501
# rcpdf = rcParams_to_df(rcp)
491
502
# print('type(rcpdf)=',type(rcpdf))
492
503
# print('rcpdfhead(3)=',rcpdf.head(3))
493
504
# return # rcpdf
494
-
495
505
496
506
497
507
def _valid_addplot_kwargs ():
0 commit comments