You are reading an old version of the documentation (v3.0.3). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.close.html
Version 3.0.3
matplotlib
Fork me on GitHub

Table of Contents

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