matplotlib / 3.5.1 / _as_gen / matplotlib.pyplot.close.html /

matplotlib.pyplot.close

matplotlib.pyplot. close ( fig=None ) [source]

Close a figure window.

Parameters
fig None 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

© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.pyplot.close.html