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

Skip to content

Honour panchor keyword for colorbar on subplot #23203

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 10, 2022

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Jun 4, 2022

PR Summary

Fixes #23157. Also added a test for the case where panchor is set to something different to the existing anchor setting on the main axes. Both tests fail without the change in the main code.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).

assert ax.get_anchor() == 'N'


def test_colorbar_single_ax_panchor_east():
Copy link
Member

Choose a reason for hiding this comment

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

Can we test this with constrained_layout as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jklymak do you mean like this?

@rcomer rcomer force-pushed the colorbar-panchor branch from 751e141 to 392d4ea Compare June 5, 2022 08:19
@timhoffm timhoffm added the PR: bugfix Pull requests that fix identified bugs label Jun 10, 2022
@timhoffm timhoffm added this to the v3.5.3 milestone Jun 10, 2022
@timhoffm timhoffm merged commit b7ca8bb into matplotlib:main Jun 10, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 10, 2022
oscargus added a commit that referenced this pull request Jun 11, 2022
…203-on-v3.5.x

Backport PR #23203 on branch v3.5.x (Honour `panchor` keyword for colorbar on subplot)
@rcomer rcomer deleted the colorbar-panchor branch June 12, 2022 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bugfix Pull requests that fix identified bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: colorbar ignores keyword panchor=False
4 participants