-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: new constrained_layout causes axes to go invisible(?) #22264
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
I can't reproduce. And obviously we test CL pretty heavily, so all our tests would fail if that didn't work at all. So you must have something else in your setup causing the problem. |
(Well, OK, I didn't try and reproduce with mplcairo)... |
Oh, that's interesting... this only occurs with mplcairo, even though I would have thought this touched something completely orthogonal to the actual renderer (this is why I didn't think about checking that part). I'll investigate, sorry for the noise. |
Well, it is weird that it doesn't work w/ mplcairo. If there is something we need to fix, we should try before release... |
Do you know if the sequence of draws changed with #20426? |
Not on purpose. However I think things changed so that the layout parameters were not hard coded when the gridspecs are created. Ie the width ratios etc are done at drawtime. That allows you to change the gridspec width ratios and have it take effect. However I think this went in before #20426 |
OK, I figured out that this occured because I was doing some weird dance to try to reuse renderer instances in order to not invalidate the text layout cache (now see #22271, which doesn't immediately address the text cache but is preliminary work in that direction), but #20426 changed something and I ended up drawing to a draw-disabled renderer. I just stripped out most of the caching for now. |
I'm going to close this since it is working as expected for unpatched Matplotlib. If when adding your "weird" renderer dance you come up with a flaw in how constrained_layout is implemented, feel free to re-raise the issue, but there is nothing actionable for the rest of us (yet). |
Bug summary
Since #20426,
plt.figure(constrained_layout=True).subplots(3)
(orlayout="constrained"
) shows no axes whatsoever.attn @jklymak, I guess :)
Code for reproduction
See above.
Actual outcome
Blank figure.
Expected outcome
Not blank figure.
Additional information
No response
Operating system
fedora
Matplotlib Version
HEAD, bisects to #20426.
Matplotlib Backend
mplcairo
Python version
310
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: