Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
FIX: do not warn when calling tight_layout multiple times#26300
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
rcomer commentedJul 13, 2023
Would it be enough to not warn when the existing layout engine isany placeholder layout engine? My understanding is that the warning is aimed at users who set up a figure with compressed/constrained layout and do not realise If you have a placeholder, I think you must already have turned the layout engine off somewhere. |
tacaswell commentedJul 13, 2023
I was worried about the case of fig=plt.figure(layout='constrained')fig.set_layout_engine('none')fig.tight_layout()# <- should this warn?! I went with "yes" on reflex but on a bit more consideration, I think "no" may be a better answer as by explicitly clearing the layout engine the user as already opted out of the automatic calls and are doing it "manually". |
18e19b3 tof7574a4Compare…out multiple times
…300-on-v3.7.xBackport PR#26300 on branch v3.7.x (FIX: do not warn when calling tight_layout multiple times)
PR summary
Closes#26290
I was between adding state to the PlaceHolder layout enigne and holding that state via a no-op sub-class. Ended up going for the second, but could see the case for the first.
PR checklist