File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1866,9 +1866,10 @@ def _get_tick_boxes_siblings(self, renderer):
1866
1866
"""
1867
1867
bboxes = []
1868
1868
bboxes2 = []
1869
+ # get the Grouper that keeps track of x-label groups for this figure
1869
1870
grp = self .figure ._align_xlabel_grp
1870
1871
# if we want to align labels from other axes:
1871
- for axx in grp .get_siblings (self .axes ):
1872
+ for nn , axx in enumerate ( grp .get_siblings (self .axes ) ):
1872
1873
ticks_to_draw = axx .xaxis ._update_ticks (renderer )
1873
1874
tlb , tlb2 = axx .xaxis ._get_tick_bboxes (ticks_to_draw , renderer )
1874
1875
bboxes .extend (tlb )
@@ -2234,6 +2235,7 @@ def _get_tick_boxes_siblings(self, renderer):
2234
2235
"""
2235
2236
bboxes = []
2236
2237
bboxes2 = []
2238
+ # get the Grouper that keeps track of y-label groups for this figure
2237
2239
grp = self .figure ._align_ylabel_grp
2238
2240
# if we want to align labels from other axes:
2239
2241
for axx in grp .get_siblings (self .axes ):
Original file line number Diff line number Diff line change @@ -381,6 +381,8 @@ def __init__(self,
381
381
self ._cachedRenderer = None
382
382
383
383
# groupers to keep track of x and y labels we want to align.
384
+ # see self.align_xlabels and self.align_ylabels and
385
+ # axis._get_tick_boxes_siblings
384
386
self ._align_xlabel_grp = cbook .Grouper ()
385
387
self ._align_ylabel_grp = cbook .Grouper ()
386
388
@@ -2133,8 +2135,7 @@ def align_xlabels(self, axs=None):
2133
2135
2134
2136
if axs is None :
2135
2137
axs = self .axes
2136
- axs = np .asarray (np .array (axs )).flatten ().tolist ()
2137
-
2138
+ axs = np .asarray (axs ).flatten ().tolist ()
2138
2139
for ax in axs :
2139
2140
_log .debug (' Working on: %s' , ax .get_xlabel ())
2140
2141
ss = ax .get_subplotspec ()
@@ -2201,7 +2202,7 @@ def align_ylabels(self, axs=None):
2201
2202
2202
2203
if axs is None :
2203
2204
axs = self .axes
2204
- axs = np .asarray (np . array ( axs ) ).flatten ().tolist ()
2205
+ axs = np .asarray (axs ).flatten ().tolist ()
2205
2206
for ax in axs :
2206
2207
_log .debug (' Working on: %s' , ax .get_ylabel ())
2207
2208
ss = ax .get_subplotspec ()
You can’t perform that action at this time.
0 commit comments