-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
transiently linked interactivity of unshared pair of axes generated with make_axes_locatable #12613
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
It may kind of be expected that the matplotlib So the code should probably rather use the
Now the problem is that this code is broken. It would work in matplotlib 2.1, but the introduction of the constrained layout killed it - bisects to #9082 (attn. @jklymak) |
I am at a loss as to how this was affected by constrained layout if constrained layout is not in your Matplotlibrc or invoked in your code. |
That PR changes 37 files, so it's sure not easy to find out what exactly went wrong there. I noticed the change of |
Maybe? But I can't reproduce this on master using Like, really, constrained_layout should do nothing on these axes... If you want to see if CL is called, put a (EDIT:) print statement the beginning of |
OK, I see, I can reproduce on 3.0.0. @ImportanceOfBeingErnest your issue is the same as the other axesgrid issues, closed by #12363 and fixed in master and 3.0.1. Not sure if this closes the issue... |
Oh sorry, I should really fetch upstream every morning or so. Apparently #12363 then fixed something which got introduced in 2.2 and something which got introduced in 3.0 at the same time. I would say yes, this closes the issue. Because I don't think we want to start supporting @Rainald62 What this means for you is that you would need to wait till 3.0.1 is out (in a couple of days, max 2 weeks) and then use the proposed code from above. Alternatively, you may always decide to not use the axis_grid1 toolkit at all and work with usual subplots from the main library. |
It was confusing. I'm surprised it bisected to #9082, but I think you are right - the set_position stuff was broken. #12363 did add a couple of tests, so hopefully this doesn't break for axesgrid again (while I think axesgrid should be moved into the main library as much as possible, I'm not actively trying to break it!) |
So the reason people use axes_grid1 with its axesdivider is that is allows to keep the geometry of axes in sync, i.e. having one fixed-aspect axes and another auto-aspect axes next to/underneath each other, they want to have them both the same height/width. There currently seems no easy way to do this with subplots from the main library (solutions are currently to calculate and set a fixed aspect to the other subplot as well, to mess with the subplot params to box up the subplots, or to set the position manually - all of which would require a callback on resize/zoom/pan/limitchange events.) Most prominently this affects colorbars for images, but of course equally other subplot combinations. |
Many thanks for the help. I updated to 3.0.1, changed to |
Bug report
Bug summary
In panning mode of the figure window, all vertical and the common horizontal axes are affected by the very first drag of the mouse, irrespective of the subplot addressed by the mouse. After that, which of the vertical axes are affected depends on the addressed subplot (almost as expected).
Code for reproduction
Actual outcome
(A bug that may be related: The right axis extends (with tick marks and tick labels) over the full height including the top subplot, although the right axis is autoscaled so that the trace assigned to it fits into the lower subplot as I expected.)
Expected outcome
If it is not needed to interactively change the top left axis, a workaround would be
ax_top.set_navigate(False)
. This works also for the very first drag.Matplotlib version
Installed using pip
The text was updated successfully, but these errors were encountered: