Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96c4e28

Browse files
committed
FIX: make unique ids longer and don't count on fixed length names
1 parent 2465e60 commit 96c4e28

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

lib/matplotlib/_constrained_layout.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,7 @@ def _arrange_subplotspecs(gs, hspace=0, wspace=0):
455455
if child._is_subplotspec_layoutbox():
456456
for child2 in child.children:
457457
# check for gridspec children...
458-
name = (child2.name).split('.')[-1][:-3]
459-
if name == 'gridspec':
458+
if child2._is_gridspec_layoutbox():
460459
_arrange_subplotspecs(child2, hspace=hspace, wspace=wspace)
461460
sschildren += [child]
462461
# now arrange the subplots...

lib/matplotlib/_layoutbox.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,20 +354,16 @@ def _is_subplotspec_layoutbox(self):
354354
Helper to check if this layoutbox is the layoutbox of a
355355
subplotspec
356356
'''
357-
name = (self.name).split('.')[-1][:-3]
358-
if name == 'ss':
359-
return True
360-
return False
357+
name = (self.name).split('.')[-1]
358+
return name[:2] == 'ss'
361359

362360
def _is_gridspec_layoutbox(self):
363361
'''
364362
Helper to check if this layoutbox is the layoutbox of a
365363
gridspec
366364
'''
367-
name = (self.name).split('.')[-1][:-3]
368-
if name == 'gridspec':
369-
return True
370-
return False
365+
name = (self.name).split('.')[-1]
366+
return name[:8] == 'gridspec'
371367

372368
def find_child_subplots(self):
373369
'''
@@ -646,7 +642,7 @@ def seq_id():
646642

647643
global _layoutboxobjnum
648644

649-
return ('%03d' % (next(_layoutboxobjnum)))
645+
return ('%06d' % (next(_layoutboxobjnum)))
650646

651647

652648
def print_children(lb):

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ class ArtistInspector(object):
10591059
"""
10601060

10611061
def __init__(self, o):
1062-
"""
1062+
r"""
10631063
Initialize the artist inspector with an `Artist` or an iterable of
10641064
`Artist`\s. If an iterable is used, we assume it is a homogeneous
10651065
sequence (all `Artists` are of the same type) and it is your

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5267,7 +5267,7 @@ def _pcolorargs(funcname, *args, allmatch=False):
52675267
@docstring.dedent_interpd
52685268
def pcolor(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
52695269
vmax=None, **kwargs):
5270-
"""
5270+
r"""
52715271
Create a pseudocolor plot with a non-regular rectangular grid.
52725272
52735273
Call signature::

0 commit comments

Comments
 (0)