Backport PR #30098 on branch v3.10.x (Fix label_outer in the presence of colorbars.) by meeseeksmachine · Pull Request #30228 · matplotlib/matplotlib · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions lib/matplotlib/axes/_base.py
4 changes: 2 additions & 2 deletions lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,7 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,

cax = fig.add_axes(pbcb, label="<colorbar>")
for a in parents:
# tell the parent it has a colorbar
a._colorbars += [cax]
a._colorbars.append(cax) # tell the parent it has a colorbar
cax._colorbar_info = dict(
parents=parents,
location=location,
Expand Down Expand Up @@ -1547,6 +1546,7 @@ def make_axes_gridspec(parent, *, location=None, orientation=None,

fig = parent.get_figure()
cax = fig.add_subplot(ss_cb, label="<colorbar>")
parent._colorbars.append(cax) # tell the parent it has a colorbar
cax.set_anchor(anchor)
cax.set_box_aspect(aspect)
cax.set_aspect('auto')
Expand Down
10 changes: 8 additions & 2 deletions lib/matplotlib/tests/test_subplots.py
Loading