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 9f00a79

Browse filesBrowse files
committed
DOC: some more comments
1 parent 17d1025 commit 9f00a79
Copy full SHA for 9f00a79

File tree

2 files changed

+7
-4
lines changed
Filter options

2 files changed

+7
-4
lines changed

‎lib/matplotlib/axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axis.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,9 +1866,10 @@ def _get_tick_boxes_siblings(self, renderer):
18661866
"""
18671867
bboxes = []
18681868
bboxes2 = []
1869+
# get the Grouper that keeps track of x-label groups for this figure
18691870
grp = self.figure._align_xlabel_grp
18701871
# 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)):
18721873
ticks_to_draw = axx.xaxis._update_ticks(renderer)
18731874
tlb, tlb2 = axx.xaxis._get_tick_bboxes(ticks_to_draw, renderer)
18741875
bboxes.extend(tlb)
@@ -2234,6 +2235,7 @@ def _get_tick_boxes_siblings(self, renderer):
22342235
"""
22352236
bboxes = []
22362237
bboxes2 = []
2238+
# get the Grouper that keeps track of y-label groups for this figure
22372239
grp = self.figure._align_ylabel_grp
22382240
# if we want to align labels from other axes:
22392241
for axx in grp.get_siblings(self.axes):

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ def __init__(self,
381381
self._cachedRenderer = None
382382

383383
# 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
384386
self._align_xlabel_grp = cbook.Grouper()
385387
self._align_ylabel_grp = cbook.Grouper()
386388

@@ -2133,8 +2135,7 @@ def align_xlabels(self, axs=None):
21332135

21342136
if axs is None:
21352137
axs = self.axes
2136-
axs = np.asarray(np.array(axs)).flatten().tolist()
2137-
2138+
axs = np.asarray(axs).flatten()
21382139
for ax in axs:
21392140
_log.debug(' Working on: %s', ax.get_xlabel())
21402141
ss = ax.get_subplotspec()
@@ -2201,7 +2202,7 @@ def align_ylabels(self, axs=None):
22012202

22022203
if axs is None:
22032204
axs = self.axes
2204-
axs = np.asarray(np.array(axs)).flatten().tolist()
2205+
axs = np.asarray(axs).flatten()
22052206
for ax in axs:
22062207
_log.debug(' Working on: %s', ax.get_ylabel())
22072208
ss = ax.get_subplotspec()

0 commit comments

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