#NEWLINE# def getfigs( * fig_nums ) : #NEWLINE# #INDENT# 'Get a list of matplotlib figures by figure numbers.\n\n    If no arguments are given, all available figures are returned.  If the\n    argument list contains references to invalid figures, a warning is printed\n    but the function continues pasting further figures.\n\n    Parameters\n    ----------\n    figs : tuple\n        A tuple of ints giving the figure numbers of the figures to return.\n    ' #NEWLINE# from matplotlib._pylab_helpers import Gcf #NEWLINE# if ( not fig_nums ) : #NEWLINE# #INDENT# fig_managers = Gcf . get_all_fig_managers ( ) #NEWLINE# return [ fm . canvas . figure for fm in fig_managers ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# figs = [ ] #NEWLINE# for num in fig_nums : #NEWLINE# #INDENT# f = Gcf . figs . get ( num ) #NEWLINE# if ( f is None ) : #NEWLINE# #INDENT# print ( ( 'Warning: figure %s not available.' % num ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# figs . append ( fig_managers . canvas . figure ) #NEWLINE# #UNINDENT# #UNINDENT# return figs