Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@tacaswell
Copy link
Member

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

@rcomer
Copy link
Member

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 realisetight_layout is incompatible (or who copy-pasted some old code and neglected to strip out thetight_layout call).#24528

If you have a placeholder, I think you must already have turned the layout engine off somewhere.

tacaswell and jklymak reacted with thumbs up emoji

@tacaswell
Copy link
MemberAuthor

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".

jklymak and rcomer reacted with thumbs up emoji

@tacaswelltacaswellforce-pushed thefix/multiple_tightlayout branch from18e19b3 tof7574a4CompareJuly 13, 2023 15:11
@jklymakjklymak merged commit6391678 intomatplotlib:mainJul 13, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJul 13, 2023
@tacaswelltacaswell deleted the fix/multiple_tightlayout branchJuly 13, 2023 20:08
@QuLogicQuLogic added the topic: geometry managerLayoutEngine, Constrained layout, Tight layout labelJul 13, 2023
tacaswell added a commit that referenced this pull requestJul 13, 2023
…300-on-v3.7.xBackport PR#26300 on branch v3.7.x (FIX: do not warn when calling tight_layout multiple times)
@rcomerrcomer mentioned this pull requestJul 31, 2023
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jklymakjklymakjklymak approved these changes

@rcomerrcomerrcomer approved these changes

Assignees

No one assigned

Labels

topic: geometry managerLayoutEngine, Constrained layout, Tight layout

Projects

None yet

Milestone

v3.7.3

Development

Successfully merging this pull request may close these issues.

[Bug]: calling fig.tight_layout multiple times

4 participants

@tacaswell@rcomer@jklymak@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp