-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
xlim is not auto scaled when using twinx #16723
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 looks like the axes are fighting each other and Possible solutions are to plot your lines on the original axes, or use |
Thanks for pointing out
twin_ax = ax.secondary_yaxis('right')
twin_ax.axhline(y=10, color='gray') With limited use examples/documentation, I am still unsure what is the different between |
Sure, a bit off topic, but secondary axis is not to be drawn on, its just to show an alternate scale. All the plotting happens on the parent axes. |
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! |
I am reporting as possible bug.
When plotting a secondary y axis on the right, the xlim is not being properly auto scaled. As possible work around was proposed here, https://stackoverflow.com/a/27344398/4988010, however, it seems this was fixed here, 26ed35b. However, I am not seeing the issue being resolved on matplotlib v3.2.0.
The text was updated successfully, but these errors were encountered: