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 2fc62a4

Browse filesBrowse files
committed
cleanup delaxes()
1 parent 0943a6c commit 2fc62a4
Copy full SHA for 2fc62a4

File tree

Expand file treeCollapse file tree

2 files changed

+10
-13
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-13
lines changed

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,11 @@ def set_frameon(self, b):
864864
self.frameon = b
865865
self.stale = True
866866

867-
def delaxes(self, a):
868-
'remove a from the figure and update the current axes'
869-
self._axstack.remove(a)
867+
def delaxes(self, ax):
868+
"""
869+
Remove the `~.Axes` *ax* from the figure and update the current axes.
870+
"""
871+
self._axstack.remove(ax)
870872
for func in self._axobservers:
871873
func(self)
872874
self.stale = True

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+5-10Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -919,19 +919,14 @@ def axes(*args, **kwargs):
919919
return a
920920

921921

922-
def delaxes(*args):
922+
def delaxes(ax=None):
923923
"""
924-
Remove an axes from the current figure. If *ax*
925-
doesn't exist, an error will be raised.
926-
927-
``delaxes()``: delete the current axes
924+
Remove the given `Axes` *ax* from the current figure. If *ax* is *None*,
925+
the current axes is removed. A KeyError is raised if the axes doesn't exist.
928926
"""
929-
if not len(args):
927+
if ax is None:
930928
ax = gca()
931-
else:
932-
ax = args[0]
933-
ret = gcf().delaxes(ax)
934-
return ret
929+
gcf().delaxes(ax)
935930

936931

937932
def sca(ax):

0 commit comments

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