def getfigs(*fig_nums):
 from matplotlib._pylab_helpers import Gcf
 if (not fig_nums):
  fig_managers = Gcf.get_all_fig_managers()
  return [fm.canvas.figure for fm in fig_managers]
 else:
  figs = []
  for num in fig_nums:
   f = Gcf.figs.get(num)
   if (f is None):
    print ('Warning: figure %s not available.' % num)
   else:
    figs.append(f.canvas.figure)
  return figs

def getfigs ( * fig_nums ) : from matplotlib . _pylab_helpers import Gcf if ( not fig_nums ) : fig_managers = Gcf . get_all_fig_managers ( ) return [ fm . canvas . figure for fm in fig_managers ] else : figs = [ ] for num in fig_nums : f = Gcf . figs . get ( num ) if ( f is None ) : print ( 'Warning: figure %s not available.' % num ) else : figs . append ( f . canvas . figure ) return figs
get a list of matplotlib figures by figure numbers .