-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
RuntimeError: adjustable='datalim' is not allowed when both axes are shared. #11416
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 combination is internally consistent only in the special case where all shared Axes have identical box aspect ratios in screen space. This is a common case, but by no means universal. Rather than blocking datalim at the outset, it might be possible to check for the consistency condition in I'm not sure it is worth trying to untangle this web in order to relax the simple blanket restriction against combining sharing of both axes with adjustable datalim. Maybe the only sensible step in that direction would be to handle the single special case in which all sharing involves both x and y in a set of Axes in a single Figure. Or maybe |
I have the same problem as @nbud. It is fairly common to have say a 2x2 grid of images displayed via imshow and you want to preserve the x-y scale after a zoom event say (e.g. R,G,B in three panels then RGB in the fourth). I'll switch back for 2.0.2 in the mean time. |
Have you considered using |
matplotlib 1.5.3 and 2.2.2 seem in conflict over this, or maybe I just don't understand which way to go. I'm updating a codebase from matplotlib 1.5.3 to 2.2.2.
That works in matplotlib 2.2.2 but matplotlib 1.5.3 raises:
It'd be good for the new code to pass our Jenkins build before I merge in the change and update the shared pyenv to the new libraries, so I tried
I don't see docs on these choices and their compatibility with shared axes. Matplotlib version
|
To me the error here is that |
I think this is just a matter of leaving long-standing behavior in place. This definition of 'equal' predates the |
Anyhow, the workaround is to call |
#15032 only adds documentation that That does not help too much for a user with the above problem because his code does not mention |
I agree with @timhoffm. I am getting the same error and my code doesn't mention |
@stormshawn are you using |
@jklymak I was using |
I am trying to share both
However, non of the option fixed the error. Any help would be very appreciable. |
Bug report
Bug summary
Matplotlib 2.2.2 fails to plot the figure described below. The code works with Matplotlib 2.0.2.
The issue seems to be the combination of
sharex=True, sharey=True
andaxis('equal')
.Code for reproduction
Actual outcome
With Matplotlib 2.2.2, the figure is not drawn and the following exception is raised:
Expected outcome
Drawn figure, no error, as with Matplotlib 2.0.2
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggThe text was updated successfully, but these errors were encountered: