Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix colorbar aspect when colorbar created, not its axes...#22100

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
jklymak wants to merge4 commits intomatplotlib:mainfromjklymak:fix-colrbar-aspect

Conversation

jklymak
Copy link
Member

PR Summary

Closes#22087 (?)

Creating a colorbar axes and then subsequently setting its aspect ratio after creation, but before creating the colorbar, failed after#20501. That is because the new colorbar logic consultscax._colorbar_info for the aspect ratio of the colorbar, and we were setting that when the colorbar axes was created. Here we change the logic so the aspect ratio is not set until the colorbar is put into the axes.

#22087 is still broken in that users used to be able to set the aspect ratio viacax.set_aspect, whereas now we are usingcax.set_box_aspect. That could maybe be fixed.

We probably should also allow a way for colorbars to reset their aspect ratio (#20588).

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

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

@jklymakjklymak marked this pull request as draftJanuary 4, 2022 09:40
@jklymak
Copy link
MemberAuthor

This logic also fails, because we modify the box_aspect as part of the algorithm to shrink the axes for extend triangles. So if we redraw, we keep making the colorbar aspect smaller and smaller!

@jklymak
Copy link
MemberAuthor

I think theproper solution here is that colorbar needs to know its aspect ratio, and that the user cannot control the underlying axes aspect ratio directly. I think that can mostly work now, but we would need to grow acolorbar.set_aspect method for post-facto aspect changes like@efiring wants to do.

@jklymakjklymak closed thisJan 4, 2022
@jklymakjklymak deleted the fix-colrbar-aspect branchJanuary 4, 2022 13:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Bug]: aspect ratio control of colorbar Axes fails.
1 participant
@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp