-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: AxesSubplot.get_yticks not returning the actual printed ticks #23717
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
If you swap the order of setting the limits and setting the ticks it works as expected.
I do not think there is much we can do here without breaking other behavior. Maybe |
Thank you very much for the answer! All right ... It makes total sense to adjust the limits when passing ticks of a broader range. So, I just remember:
P.S. Side question: Is there any guide, tutorial or a like about the inner workings of mpl apart from the doc-strings? |
I'm working on a PR to add a note about returning locations out of the current view limits. As for where to get more information:
|
Uh oh!
There was an error while loading. Please reload this page.
Bug summary
get_x/yticks
seems to have some padding but does not return the actual printed ticks.Code for reproduction
Actual outcome
yields a correct visual equivalence
but adding
ax2.set_yticks( ax.get_yticks() )
yields:

Expected outcome
Both axes with equal visual appearance when using
ax2.set_yticks( ax.get_yticks() )
.Additional information
Why is this behavior problematic?
Consider e.g.:
Thanks for any help / investigation!
Operating system
Arch
Matplotlib Version
3.5.2
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
3.10.5
Jupyter version
jupyter lab --version == 3.4.4
Installation
Linux package manager
The text was updated successfully, but these errors were encountered: