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 3e078bc

Browse filesBrowse files
lpsingertimhoffm
andauthored
Update lib/matplotlib/figure.py
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 261b9c5 commit 3e078bc
Copy full SHA for 3e078bc

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-4
lines changed

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,12 +1444,10 @@ def gca(self, **kwargs):
14441444
"axes, or if no axes exist, create new axes with default "
14451445
"keyword arguments. To create a new axes with non-default "
14461446
"arguments, use plt.axes() or plt.subplot().")
1447-
cax = self._axstack()
1448-
if cax is None:
1449-
# no axes found, so create one which spans the figure
1447+
if self._axstack.empty():
14501448
return self.add_subplot(1, 1, 1, **kwargs)
14511449
else:
1452-
return cax
1450+
return self._axstack()
14531451

14541452
def _gci(self):
14551453
# Helper for `~matplotlib.pyplot.gci`. Do not use elsewhere.

0 commit comments

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