def close(fignum=None): from matplotlib.pyplot import get_fignums, close as _close if fignum is None: for fignum in get_fignums(): _close(fignum) else: _close(fignum)
def close(fignum=None): from matplotlib.pyplot import get_fignums, close as _close if fignum is None: for fignum in get_fignums(): _close(fignum) else: _close(fignum)
def close(fignum=None) -> None: from matplotlib.pyplot import ( close as _close, get_fignums, ) if fignum is None: for fignum in get_fignums(): _close(fignum) else: _close(fignum)
def close_figure(fig=None): """Close a matplotlibt figure. Parameters ---------- fig : int or str or Figure, optional (default=None) The figure, figure number or figure name to close. If ``None``, all current figures are closed. """ from matplotlib.pyplot import get_fignums, close as _close # noqa if fig is None: for fig in get_fignums(): _close(fig) else: _close(fig)