Skip to content

Commit 30c8b8c

Browse files
authored
Fix docstring lib/matplotlib/pyplot.py and related lib/matplotlib/__init__.py (matplotlib#31168)
* DOC: Remove inaccurate claim that switch_backend closes all figures The switch_backend docstring claimed that all open figures would be closed via plt.close('all') when switching to a different backend, but the implementation never actually does this. * DOC: Remove same inaccurate close-all claim from matplotlib.use docstring The matplotlib.use docstring also claimed figures would be closed when switching backends, which is equally incorrect.
1 parent 7eaff94 commit 30c8b8c

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,8 +1192,7 @@ def use(backend, *, force=True):
11921192
Select the backend used for rendering and GUI integration.
11931193
11941194
If pyplot is already imported, `~matplotlib.pyplot.switch_backend` is used
1195-
and if the new backend is different than the current backend, all Figures
1196-
will be closed.
1195+
to switch the backend.
11971196
11981197
Parameters
11991198
----------

lib/matplotlib/pyplot.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,6 @@ def switch_backend(newbackend: str) -> None:
398398
another interactive backend has started. Switching to and from
399399
non-interactive backends is always possible.
400400
401-
If the new backend is different than the current backend then all open
402-
Figures will be closed via ``plt.close('all')``.
403-
404401
Parameters
405402
----------
406403
newbackend : str

0 commit comments

Comments
 (0)