Get a list of matplotlib figures by figure numbers. If no arguments are given, all available figures are returned. If the argument list contains references to invalid figures, a warning is printed but the function continues pasting further figures. Parameters ---------- fi
(*fig_nums)
| 57 | |
| 58 | |
| 59 | def getfigs(*fig_nums): |
| 60 | """Get a list of matplotlib figures by figure numbers. |
| 61 | |
| 62 | If no arguments are given, all available figures are returned. If the |
| 63 | argument list contains references to invalid figures, a warning is printed |
| 64 | but the function continues pasting further figures. |
| 65 | |
| 66 | Parameters |
| 67 | ---------- |
| 68 | figs : tuple |
| 69 | A tuple of ints giving the figure numbers of the figures to return. |
| 70 | """ |
| 71 | from matplotlib._pylab_helpers import Gcf |
| 72 | if not fig_nums: |
| 73 | fig_managers = Gcf.get_all_fig_managers() |
| 74 | return [fm.canvas.figure for fm in fig_managers] |
| 75 | else: |
| 76 | figs = [] |
| 77 | for num in fig_nums: |
| 78 | f = Gcf.figs.get(num) |
| 79 | if f is None: |
| 80 | print('Warning: figure %s not available.' % num) |
| 81 | else: |
| 82 | figs.append(f.canvas.figure) |
| 83 | return figs |
| 84 | |
| 85 | |
| 86 | def figsize(sizex, sizey): |
nothing calls this directly
no outgoing calls
no test coverage detected