You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.0.2.post1670+gd3e8ce39c
Fork me on GitHub

Table of Contents



Close a figure window.

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