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

Skip to content

Fix label_outer in the presence of colorbars. #30098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 23, 2025

The subgridspec to be considered should be the one containing both the axes and the colorbar, not the sub-subgridspec of just the axes.

Closes #27305 (using #27305 (comment) and a test).

PR summary

PR checklist

@anntzer anntzer added topic: geometry manager LayoutEngine, Constrained layout, Tight layout topic: color/colorbar labels May 23, 2025
@github-actions github-actions bot added topic: axes and removed topic: geometry manager LayoutEngine, Constrained layout, Tight layout labels May 23, 2025
f, axs = plt.subplots(2, 2, sharex=True, sharey=True)
@pytest.mark.parametrize('with_colorbar', [True, False])
def test_label_outer(remove_ticks, with_colorbar):
fig, axs = plt.subplots(2, 2, sharex=True, sharey=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this get tested with layout=constrained as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (but the flagging above with _is_colorbar_gridspec still needs to be done).

The subgridspec to be considered should be the one containing both the
axes and the colorbar, not the sub-subgridspec of just the axes.
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me.

@timhoffm timhoffm added this to the v3.10.4 milestone Jun 30, 2025
@timhoffm timhoffm merged commit d797ee5 into matplotlib:main Jun 30, 2025
40 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 30, 2025
@anntzer anntzer deleted the locb branch June 30, 2025 11:40
oscargus pushed a commit that referenced this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Axes.label_outer() does not work when there is a colorbar
4 participants