Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cff76d1

Browse filesBrowse files
committed
MNT/DOC: remove all usage of Figure.clf from codebase
1 parent f37add1 commit cff76d1
Copy full SHA for cff76d1

File tree

Expand file treeCollapse file tree

4 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+4
-4
lines changed

‎doc/api/prev_api_changes/api_changes_3.0.0.rst

Copy file name to clipboardExpand all lines: doc/api/prev_api_changes/api_changes_3.0.0.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ Hold machinery
471471
Setting or unsetting ``hold`` (:ref:`deprecated in version 2.0<v200_deprecate_hold>`) has now
472472
been completely removed. Matplotlib now always behaves as if ``hold=True``.
473473
To clear an axes you can manually use :meth:`~.axes.Axes.cla()`,
474-
or to clear an entire figure use :meth:`~.figure.Figure.clf()`.
474+
or to clear an entire figure use :meth:`~.figure.Figure.clear()`.
475475

476476

477477
Removal of deprecated backends

‎doc/users/prev_whats_new/changelog.rst

Copy file name to clipboardExpand all lines: doc/users/prev_whats_new/changelog.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3139,7 +3139,7 @@ the `API changes <../../api/api_changes.html>`_.
31393139
Fixed a bug in backend_qt4, reported on mpl-dev - DSD
31403140

31413141
2007-03-26
3142-
Removed colorbar_classic from figure.py; fixed bug in Figure.clf() in which
3142+
Removed colorbar_classic from figure.py; fixed bug in Figure.clear() in which
31433143
_axobservers was not getting cleared. Modernization and cleanups. - EF
31443144

31453145
2007-03-26

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def close(fig=None):
953953

954954
def clf():
955955
"""Clear the current figure."""
956-
gcf().clf()
956+
gcf().clear()
957957

958958

959959
def draw():

‎lib/matplotlib/tests/test_usetex.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_usetex.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_minus_no_descent(fontsize):
7474
heights = {}
7575
fig = plt.figure()
7676
for vals in [(1,), (-1,), (-1, 1)]:
77-
fig.clf()
77+
fig.clear()
7878
for x in vals:
7979
fig.text(.5, .5, f"${x}$", usetex=True)
8080
fig.canvas.draw()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.