-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make sure SubFigure has _cachedRenderer #23174
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
Conversation
I'm not sure this is the correct fix? The renderer for the subfigure should be the same as the parent's renderer. I think we need to set this up as a property and have the getter go up the tree to the parent? |
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone can merge on green.
I restarted the failed windows job (it was a blit test in a subprocess I have not seen fail before 🤞🏻 it is transient). |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
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 If these instructions are inaccurate, feel free to suggest an improvement. |
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
PR Summary
Makes sure that
_cachedRenderer
is added toSubFigure
instances 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
SubFigure
and not aFigure
.PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and 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).