8000 FIX · matplotlib/matplotlib@433b6b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 433b6b7

Browse files
committed
FIX
1 parent de4da22 commit 433b6b7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/matplotlib/gridspec.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,15 @@ def _check_gridspec_exists(figure, nrows, ncols):
210210
"""
211211
gs = None
212212
for ax in figure.get_axes():
213-
if hasattr(ax, 'get_subplotspec'):
214-
ggs = ax.get_subplotspec().get_gridspec()
215-
if hasattr(ggs, 'get_topmost_subplotspec'):
213+
if hasattr(ax, 'get_subplotspec'):
214+
ggs = ax.get_subplotspec().get_gridspec()
215+
if hasattr(ggs, 'get_topmost_subplotspec'):
216216
# This is needed for colorbar gridspec layouts.
217217
# This is probably OK becase this whole logic tree
218218
# is for when the user is doing simple things with the
219219
# add_subplot command. Complicated stuff, the proper
220220
# gridspec is passed in...
221221
ggs = ggs.get_topmost_subplotspec().get_gridspec()
222-
223222
(nrow, ncol) = ggs.get_geometry()
224223
if nrow == nrows and ncol == ncols:
225224
gs = ggs
@@ -722,7 +721,6 @@ def _from_subplot_args(figure, args):
722721
gs = GridSpec(rows, cols, figure=figure)
723722
return gs[i-1:j]
724723

725-
726724
# num2 is a property only to handle the case where it is None and someone
727725
# mutates num1.
728726

0 commit comments

Comments
 (0)
0