Skip to content

Doc fixed aspect colorbar #29945

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 3 commits into from
Apr 18, 2025
Merged

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Apr 18, 2025

Closes #29938

Adds text to placing colorbars and constrained layout guide that points out the role of compressed layout in making colorbars match the size of the parent axes.

The colorbar placement example in this section was pretty complex, and I'm not sure it was necessary so I just replaced with the simpler one-axes example.

@github-actions github-actions bot added the Documentation: user guide files in galleries/users_explain or doc/users label Apr 18, 2025
@jklymak jklymak added Documentation and removed Documentation: user guide files in galleries/users_explain or doc/users labels Apr 18, 2025
@jklymak jklymak requested a review from Copilot April 18, 2025 17:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR clarifies the role of layout engines in colorbar sizing by simplifying examples and adding descriptive text to guide users. Key changes include:

  • Adding new examples in constrainedlayout_guide.py demonstrating colorbar behavior with both 'constrained' and 'compressed' layouts.
  • Simplifying the colorbar placement example in colorbar_placement.py and providing an alternative using inset_axes with clear guidance.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
galleries/users_explain/axes/constrainedlayout_guide.py Adds examples showing dynamic colorbar resizing using different layouts.
galleries/users_explain/axes/colorbar_placement.py Replaces a complex example with a simplified one and introduces inset_axes usage.

@github-actions github-actions bot added the Documentation: user guide files in galleries/users_explain or doc/users label Apr 18, 2025
@tacaswell tacaswell merged commit 0ba29f5 into matplotlib:main Apr 18, 2025
22 checks passed
@tacaswell tacaswell added this to the v3.11.0 milestone Apr 18, 2025
@jklymak jklymak deleted the doc-fixed-aspect-colorbar branch April 18, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: user guide files in galleries/users_explain or doc/users Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH]: plt.colorbar add a colorbar which has the same height/width of original image
2 participants