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 085bbd7

Browse filesBrowse files
committed
FIX: resolve conflict
1 parent 6bf26c6 commit 085bbd7
Copy full SHA for 085bbd7

File tree

Expand file treeCollapse file tree

2 files changed

+9
-14
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-14
lines changed

‎lib/matplotlib/_constrained_layout.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_constrained_layout.py
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def do_constrained_layout(fig, renderer, h_pad, w_pad,
272272
# This routine makes all the subplot spec containers
273273
# have the correct arrangement. It just stacks the
274274
# subplot layoutboxes in the correct order...
275-
arange_subplotspecs(child, hspace=hspace, wspace=wspace)
275+
_arange_subplotspecs(child, hspace=hspace, wspace=wspace)
276276

277277
# - Align right/left and bottom/top spines of appropriate subplots.
278278
# - Compare size of subplotspec including height and width ratios
@@ -443,7 +443,7 @@ def do_constrained_layout(fig, renderer, h_pad, w_pad,
443443
ax._set_position(newpos, which='original')
444444

445445

446-
def arange_subplotspecs(gs, hspace=0, wspace=0):
446+
def _arange_subplotspecs(gs, hspace=0, wspace=0):
447447
"""
448448
arange the subplotspec children of this gridspec, and then recursively
449449
do the same of any gridspec children of those gridspecs...
@@ -453,9 +453,8 @@ def arange_subplotspecs(gs, hspace=0, wspace=0):
453453
if child._is_subplotspec_layoutbox():
454454
for child2 in child.children:
455455
# check for gridspec children...
456-
name = (child2.name).split('.')[-1][:-3]
457-
if name == 'gridspec':
458-
arange_subplotspecs(child2, hspace=hspace, wspace=wspace)
456+
if child2._is_gridspec_layoutbox():
457+
_arange_subplotspecs(child2, hspace=hspace, wspace=wspace)
459458
sschildren += [child]
460459
# now arrange the subplots...
461460
for child0 in sschildren:

‎lib/matplotlib/_layoutbox.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_layoutbox.py
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,20 +358,16 @@ def _is_subplotspec_layoutbox(self):
358358
Helper to check if this layoutbox is the layoutbox of a
359359
subplotspec
360360
'''
361-
name = (self.name).split('.')[-1][:-3]
362-
if name == 'ss':
363-
return True
364-
return False
361+
name = (self.name).split('.')[-1]
362+
return name[:2] == 'ss'
365363

366364
def _is_gridspec_layoutbox(self):
367365
'''
368366
Helper to check if this layoutbox is the layoutbox of a
369367
gridspec
370368
'''
371-
name = (self.name).split('.')[-1][:-3]
372-
if name == 'gridspec':
373-
return True
374-
return False
369+
name = (self.name).split('.')[-1]
370+
return name[:8] == 'gridspec'
375371

376372
def find_child_subplots(self):
377373
'''
@@ -650,7 +646,7 @@ def seq_id():
650646

651647
global _layoutboxobjnum
652648

653-
return ('%03d' % (next(_layoutboxobjnum)))
649+
return ('%06d' % (next(_layoutboxobjnum)))
654650

655651

656652
def print_children(lb):

0 commit comments

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