-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: title position incorrect for polar plot #29381
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
Comments
Without having tested in code, I suspect that prior to #28300, l.3006
the “unknown” has likely caught the polar tick. That has been cut out by a visible check on all tick.label2, an assumption that is correct only for rectangular axes, where label2 corresponds to the top labels of the x axis. |
Well I'm glad I left good notes because otherwise what I did would be a mystery to me 😅. From #26150 (comment) Past Me thought another good option would be to return an extra option from Thanks @jkittner for the clear report and for doing the bisect. |
Or “other”? |
Why "other"? That seems no more specific than "unknown". For the sharex case we know that neither top nor bottom ticks are visible, so we can explicitly check for that case which is not currently considered by |
Sorry, maybe out of context because I’m writing from a phone and may have overlooked something. |
…itioning - Add new public method get_title_top() to calculate title position - Implement specialized versions for PolarAxes and GeoAxes - Add tests for different projections - Update _adjust_title_position to use the new method This change allows subclasses to customize title positioning by overriding get_title_top(), fixing the title position issue in polar plots (matplotlib#29381).
…itioning - Add new public method get_title_top() to calculate title position - Implement specialized versions for PolarAxes and GeoAxes - Add tests for different projections - Update _adjust_title_position to use the new method - Improve documentation and code clarity This change allows subclasses to customize title positioning by overriding get_title_top(), fixing the title position issue in polar plots (matplotlib#29381).
- Fix code style issues - Add test fixtures - Improve documentation - Clean up whitespace and formatting - Fix test stub errors
Bug summary
When using a polar coordinate system the plot title overlaps with the axis labels. This worked in 3.9.4 and broke with 3.10.0. This commit broke it: 8abe308 via #28300
Code for reproduction
Actual outcome
The title overlaps the axis labels
Expected outcome
The title should be above the axis labels
Additional information
I performed a git bisect using this:
a small test script
check.py
- there's probably a better way, but that's what I came up with. (Note that the issues also comes up when not using `bbox_inches='tight', but this way it was easier to bisect, since I could instrument the image size)finally,
After a few steps it yielded this suspicious commit: 8abe308 (cc @rcomer) which was merged in #28300
Operating system
Ubuntu 22.04
Matplotlib Version
3.10.0.dev1180+gc2d502d219
Matplotlib Backend
agg
Python version
3.13.1
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: