-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
The original xlim changed by twinx #6860
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
When making grids of axes that should share tick labels, it is best to use the In all cases the y-limit of the original I think a pull request to copy the auto-scale state to the twined x-axis is a good idea, but do not think that propagating anything about the y-axis to the twin is a good idea. |
@tacaswell looking at the docs for plt.subplots that |
Sure, why wouldn't it? I can see why it might not be the case to do so most On Fri, Aug 19, 2016 at 9:49 AM, Conner Phillips notifications@github.com
|
I was just seeing sharex/sharex in the context of reducing redundant axis labels. But thinking about it, it makes sense in the case of a small multiples layout. |
The issue: when making a twinx of the original axis with xlim and ylim explicitly set, the twinx axis and the plotting actions that follow will change the xlim of the original plot. "Semantically", all the plots are still correct, but I doubt whether this is the intended behavior.
This can sometimes leads to serious confusions. One example is when the axis (and its twinx) is part of an axes grid, and when its xticklabels are set to be invisible (which is common in a regular grid of axes). In this case, plotting actions with twinx will change the x axis range implicitly and unknowingly, hence changing the alignment with other axes, making the quantitative interpretation of the plots impossible.
From the source code of twinx it is clear to me that the twinx only "inherits" the position of the original axis. I am thinking that it might be more helpful if it inherits all the properties of the original x axis.
See the following examples.
The text was updated successfully, but these errors were encountered: