matplotlib.pyplot.close#

matplotlib.pyplot.close(fig: None | int | str | Figure | Literal['all'] = None) None[source]#

Close a figure window.

Parameters:
figNone or int or str or Figure

The figure to close. There are a number of ways to specify this:

  • None: the current figure

  • Figure: the given Figure instance

  • int: a figure number

  • str: a figure name

  • 'all': all figures

Examples using matplotlib.pyplot.close#

Pong

Pong

Multipage PDF

Multipage PDF

Multiprocessing

Multiprocessing

Tight Layout guide

Tight Layout guide