-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Tick label alignment not working as described #13440
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
This is a two part issue:
will result in |
Ok, thanks a lot. @1 @2 If anyone knows a hotfix, I'd be happy to know. |
@1 @2 As a workaround, you can do
or if you don't want to tune with hard-coded numbers
|
Labeling as hard (borderline wontfix, I'd say) because making all y labels talk to each other to achieve proper left-alignment would require quite a bit of work, I think. |
This might be handled best via a TextCollection class as proposed in #4063. |
@timhoffm it seems like the issue has been fixed with |
I think the docs have been fixed from 3.1.1 (looking at the milestone on that PR), but I think that @timhoffm suggestion to render the figure once to get the text sizes and then shift the padding out is the only reliable way to do this currently. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
The docs are fixed and even though it is annoying, the behavior from #13440 (comment) for setting the left alignment is the correct and expected behavior. You can adjust the pad on the tick labels to push them out. If you are willing to use axisartist this is supported: I am going to close this as resolved. |
Bug report
Bug summary
I want to change the horizontal alignment of the tick labels on my y-axis. This page explains a method (the one-liner on the top of the page), which does not work.
Code for reproduction
The code above is slightly longer than minimum, to motivate why I need to change the tick label alignment. The changing size of the exponent looks ugly when the labels are right-aligned.
Actual outcome
Expected outcome
I expect the alignment of the y-axis tick labels to change.
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggInstalled via conda.
The text was updated successfully, but these errors were encountered: