Primary
pyplot.close() ⚬|Documentation|1st|20251021110900-00-⌔
matplotlib.pyplot.close — Matplotlib 3.10.8 documentation#matplotlib.pyplot.close
matplotlib.pyplot.close(fig=None)Close a figure window, and unregister it from pyplot.
Parameters:
fig: None or int or str orFigureThe figure to close. There are a number of ways to specify this:
- None: the current figure
Figure: the givenFigureinstanceint: a figure numberstr: a figure name- ‘all’: all figures
Notes:
pyplot maintains a reference to figures created with
figure(). When work on the figure is completed, it should be closed, i.e. deregistered from pyplot, to free its memory (see alsorcParams["figure.max_open_warning"](default:20)). Closing a figure window created byshow()automatically deregisters the figure. For all other use cases, most prominentlysavefig()withoutshow(), the figure must be deregistered explicitly usingclose().Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •