-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Axes with sharex can have divergent axes after setting tick markers #8946
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
Thanks for providing an easy to copy/paste example. I can confirm this is a problem on the master branch, with python 3.6. Adding |
@dstansby Can you render a figure with miss-matched limits? |
The figure shown by calling |
If somebody picks this up, this would be a good test (adapted from #10691):
|
As per my comment in #18529, this is fine, and I can see why we'd expect the axes to match. However, fi we change this, the converse - where the user cannot explicitly set one set of ticks, but not the others, becomes impossible. I think its pretty easy for a user to loop through the axes and explicitly set them, rather than us doing it automatically, and making it impossible for them to be different. Over all, does "sharing" an axes mean that everything is the same about the axes? I think the major convenience is having zooming linked when looking at the plot interactively, so that when I zoom on one axes, it zooms on the other. I'm less interested in the decorations on the axes precisely tracking one another, particularly if the user specifies them manually. |
@jklymak the issue is labeled 'confirmed bug' and has assigned milestone. What's the preferred way of initiating work on an issue like this? |
@l-johnston Not your fault at all - after some thought, I'm just not sure I agree that this is really something we want to do. I actually have it on today's dev call to quickly decide... |
OK, dev call today it was decided that this is the intended behaviour. The fix is believed to be easier than #18529... |
Bug report
When creating two axes using:
It is expected that the return values of ax1.get_xlim() and ax2.get_xlim() should always be identical. I.e. that the two axes share a single domain. This bug shows an example where these diverge.
Code for reproduction
Run the following snippet:
and the return is :
(-10.0, 19.0)
(-2.0, 16.0)
when it is expected that both should be (-10.0, 19.0)
pip install of matplotlib
PS: Your template for issues is very helpful!
The text was updated successfully, but these errors were encountered: