You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Auto-scaling of extent not working for subplots when using sharex and sharey #1325
Not really (see feedback on the mailing list.) Your example that way fails to set the extent as well. So I will add it here as another way to reproduce.
The sharing is working for me, but the extent isn't set right in that example either. Actually, that example is diagnostically helpful. Cheers for posting it.
shared_axes and aspect=1 does not play along well . If both parameters are set, matplotlib changes the adjustable parameter to "datalim" (default is "box"). And when the aspect is applied during the drawing time, it changes the data-limits (not box size).
If you have both x- and -y axes are shared and all the shared axes have aspect=1, you can change the adjustable to "box-forced" which will work as expected.
Punting this to (at least) 1.4.x as this is an issue with too many constraints on the limits not playing nice with each other/having unclear precedence/hysteresis.
Sorry for not having answered above. @leejjoon 's workaround does work for me, even showing the sharing of the axes work. I don't remember why we had such a inflated example though. These days I would just do:
Activity
dmcdougall commentedon Oct 3, 2012
Thanks for this @michaelaye. Apologies for the messy advice on the mailing list. Did you manage to get the workaround functional?
Hopefully this can get some visibility before the 1.2 release.
Thanks again.
michaelaye commentedon Oct 3, 2012
Not really (see feedback on the mailing list.) Your example that way fails to set the extent as well. So I will add it here as another way to reproduce.
michaelaye commentedon Oct 3, 2012
The following code with the setting of an extent at the end fails to work for me as well. As a side, it also does not share the x and y axis.
dmcdougall commentedon Oct 3, 2012
The sharing is working for me, but the extent isn't set right in that example either. Actually, that example is diagnostically helpful. Cheers for posting it.
leejjoon commentedon Oct 5, 2012
shared_axes and aspect=1 does not play along well . If both parameters are set, matplotlib changes the adjustable parameter to "datalim" (default is "box"). And when the aspect is applied during the drawing time, it changes the data-limits (not box size).
If you have both x- and -y axes are shared and all the shared axes have aspect=1, you can change the adjustable to "box-forced" which will work as expected.
pelson commentedon May 22, 2013
@michaelaye - did @leejjoon 's suggestion work for you?
tacaswell commentedon Jun 4, 2014
Punting this to (at least) 1.4.x as this is an issue with too many constraints on the limits not playing nice with each other/having unclear precedence/hysteresis.
michaelaye commentedon Jun 4, 2014
Sorry for not having answered above. @leejjoon 's workaround does work for me, even showing the sharing of the axes work. I don't remember why we had such a inflated example though. These days I would just do:
Was there no subplots available in Oct 2012? Time flies...
Edit: Ah, my bad. it was the distinction between subplots and add_subplot that was the essence of this bug in the first place.
tacaswell commentedon Jul 17, 2015
Closing as the
set_adjustablefixes the problem and the default behavior looks like a feature not a bug.