| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
BTW, I have no real way to test this, other than the existing tests, which pass.... |
Sorry, something went wrong.
|
I agree that this is better; likely this "use the cached renderer" logic should always be used even in backend_bases._get_renderer as long as print_method is None (i.e. we're not in a context of savefig with a known format)? That can be fixed lated, though. |
Sorry, something went wrong.
There was a problem hiding this comment.
Seems a bit odd that everything is routed through tight_layout, but this closes at least 2 issues.
Sorry, something went wrong.
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
git checkout v3.5.x git pull
git cherry-pick -x -m1 9e0eb54fd98bb804f51a74101db88164870a2458
git commit -am 'Backport PR #22732: FIX: maybe improve renderer dance'
git push YOURFORK v3.5.x:auto-backport-of-pr-22732-on-v3.5.x
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the Still Needs Manual Backport label once the PR gets merged. If these instructions are inaccurate, feel free to suggest an improvement. |
Sorry, something went wrong.
As noted above, probably that logic should be pulled out of TL and moved into backend_bases. |
Sorry, something went wrong.
|
This backport is odd because a bunch of stuff has moved around.....I'm doing it and will make sure the two linked issues still work. |
Sorry, something went wrong.
Merge pull request matplotlib#22732 from jklymak/fix-renderer-dance FIX: improve cached renderer dance (cherry picked from commit 9e0eb54) The changes had to be moved to figure.py due to a major refactoring that will be released in 3.6 that is already on main.
#22745 Moves the logic to Figure. The Figure holds the cache, so I'm not clear what we gain from putting the logic in the backends? |
Sorry, something went wrong.
…-v3.5.x Backport PR #22732: FIX: maybe improve renderer dance
|
It doesn't really matter to me whether figure or b_bases hold that logic (well, in my view figure is more just for artists and b_bases for canvas/renderer related stuff, but that's no big deal), mostly the point is that having that in t_l doesn't make much sense. |
Sorry, something went wrong.
Merge pull request matplotlib#22732 from jklymak/fix-renderer-dance FIX: improve cached renderer dance (cherry picked from commit 9e0eb54) The changes had to be moved to figure.py due to a major refactoring that will be released in 3.6 that is already on main.
| Back | FazBrowse Home | New Git URL |
PR Summary
Closes #22673
tight_layout and constrained_layout were both calling backend_bases._get_renderer. However, that was probably too low-level, and seems to cause canvas-dpi related flakiness as in #22673, in particular some users were seeing changed dpi because savefig.format was set to a vector backend.
This uses the more robust algorithm in _tight_layout.get_renderer. In particular if fig.canvas already exists and has a renderer, use that because it means the user has already (perhaps interactively) created a canvas. This stops prematurely falling back to a default canvas indicated by savefig.format. This probably mostly worked for folks because the default format is png which is enough like on-screen display that things didn't break.
PR Checklist
Tests and Styling
Documentation