Make sure SubFigure has _cachedRenderer - #23174
Conversation
No idea. What you says make sense though, so I'll give it a go. |
|
On |
02fde42 to
ad1dfe5
Compare
ad1dfe5 to
4e5019e
Compare
|
Updated with properties. Not convinced that one need to set the renderer in |
|
The subfigure really should not have a cached renderer, but subfigures have been abstracted to be like figures so that child artists don't know if they are in a figure or a subfigure. So if an artist does |
|
I think this is correct. Note that #22745 would have fixed this as well by calling |
Ahh, OK! Maybe better to try to get that in then? I have not really followed (nor fully understand) that discussion. I guess that the test added here very well can be worthwhile keeping as it seems to exercise the code in a way that once was (currently is) broken. |
|
I think we can have both fixes. #22745 isn't necessarily going to go in ;-) |
|
I suspect this is an argument as to why we actually do need to cache the renderer (and should move it to a central canonical place) and my position that we should not cache it at all is wrong (or at least currently infeasible). |
|
I restarted the failed windows job (it was a blit test in a subprocess I have not seen fail before 🤞🏻 it is transient). |
Merge pull request matplotlib#23174 from oscargus/clabelsubfigures FIX: Make sure SubFigure has _cachedRenderer (cherry picked from commit af83578)
…-v3.5.x Backport PR #23174: Make sure SubFigure has _cachedRenderer
Merge pull request matplotlib#23174 from oscargus/clabelsubfigures FIX: Make sure SubFigure has _cachedRenderer (cherry picked from commit af83578)

PR Summary
Makes sure that
_cachedRendereris added toSubFigureinstances by moving it toFigureBase. Closes #23173Maybe the code in contour should behave differently, but I assume that sooner or later the same problem may happen in other code when applied to a
SubFigureand not aFigure.PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).