| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I don't like this fix but I don't know any really good solution. It break my usual work process and I believe that the behavior is going to feel strange and inconsistent. Labels are going to be clipped sometimes when zooming and the figure is not going to update as expected if you happen to have clicked the zoom button (I believe that I usually has the zoom button active most of the time) and this could be really confusing. I believe that tight_layout=True haven't worked as expected and that #10989 was a similar problem. The problem just became much more obvious when the spines where included in the tight_layout calculation. I believe that a better solution would be to ignore the spines when tight_layout=True. That would probably get the same behavior as in 2.2.2. I updated #11739 to just be used with tight_layout=True |
Sorry, something went wrong.
Yes, thats correct - when the zoom button is active the axes resizing will stop. I think its pretty arguable whether the axes size should jump around while zooming. An alternative approach is to take the spines out of the layout process for tight layout only by setting them manually to not be in the layout : set_in_layout(False). Thats preferable to just taking spines out for any use of get_tightbbox. If you just remove spines then savefig(bbox='tight') won't work anymore for spines that are significantly displaced from their axes. |
Sorry, something went wrong.
I believe that it is the exact behavior that you want if you use set_tight_layout(True). The axes usually don't jump around that much that it seems strange either. |
Sorry, something went wrong.
|
OK, this version just takes spines out of the layout if tight_layout is called. The only drawback is that they will still be taken out for savefig(bbox='tight') |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Fixes #11737, and supersedes #11739
We are now consulting all axes children when doing get_tightbbox (my fault: #10682), including spines. There is some sort of problem with spines not having there transform set before draw when zoom is being used, and this leads to impossible bbox calculations. (See #11627).
This PR adopts the same soln as #11627 and disables tight_layout while zoom and pan are active. This will keep the axes the same size during interactive use, which to my mind is preferable to having the axes change size all the time. However, others may disagree w that.
This PR also has failing tight_layouts just refuse to update the axes positions, whereas before they drew a collapsed axes. Again, in my opinion, drawing something reasonable is better than drawing something that is broken.
And use the GUI to zoom. Before this PR, the axes collapsed. Now the axes doesn't change at all because zoom is active.
Note it might be nice to consider when "Zoom" is turned off to trigger a draw, then CL and TL can be made to work.
Of course the original problem is that the transform of the spines is not being set early enough. Not really sure what the soln to that is.
PR Checklist