File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ def get_renderer(fig):
44
44
45
45
return renderer
46
46
47
+ len_seq = 6 # number of digints in unique id. See seq_id below...
47
48
48
49
class LayoutBox (object ):
49
50
"""
@@ -354,7 +355,9 @@ def _is_subplotspec_layoutbox(self):
354
355
Helper to check if this layoutbox is the layoutbox of a
355
356
subplotspec
356
357
'''
357
- name = (self .name ).split ('.' )[- 1 ][:- 3 ]
358
+ global len_seq
359
+
360
+ name = (self .name ).split ('.' )[- 1 ][:- len_seq ]
358
361
if name == 'ss' :
359
362
return True
360
363
return False
@@ -364,7 +367,9 @@ def _is_gridspec_layoutbox(self):
364
367
Helper to check if this layoutbox is the layoutbox of a
365
368
gridspec
366
369
'''
367
- name = (self .name ).split ('.' )[- 1 ][:- 3 ]
370
+ global len_seq
371
+
372
+ name = (self .name ).split ('.' )[- 1 ][:- len_seq ]
368
373
if name == 'gridspec' :
369
374
return True
370
375
return False
@@ -645,8 +650,10 @@ def seq_id():
645
650
'''
646
651
647
652
global _layoutboxobjnum
653
+ global len_seq
648
654
649
- return ('%03d' % (next (_layoutboxobjnum )))
655
+ fstr = '%0{}d' .format (len_seq )
656
+ return (fstr % (next (_layoutboxobjnum )))
650
657
651
658
652
659
def print_children (lb ):
You can’t perform that action at this time.
0 commit comments