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

TightLayoutEngine.execute runs get_tight_layout_figure twice#26203

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

Open
leejjoon wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromleejjoon:tightlayout-twice

Conversation

leejjoon
Copy link
Contributor

PR summary

IfAutoLocator is used, changing the location of axes may change the ticklabels.
Thus the result of tight_layout may not be optimal.

fig=plt.figure(layout="tight",figsize=(3,3))fig.subplots(3,3)fig.set_facecolor("0.8")

tightlayout_single

The PR simply runs the algorithm twice.

tightlayout_double

  • ConstrainedLayoutEngine also runs its algorithm twice (_constrained_layout.do_constrained_layout)
  • There are failing tests, because the result of running the algorithm twice can be different for running it only once. We need to update the baseline images if this PR to be accepted.
  • I can add a simple test if requested.
  • My intention is to have this PR merged before I further work ontight_layout support for subfigure #26108.

PR checklist

  • new and changed code istested

@QuLogicQuLogic added the topic: geometry managerLayoutEngine, Constrained layout, Tight layout labelJun 27, 2023
Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This seems like a fine thing to do. Not sure if we want to change that many images.

@timhoffm
Copy link
Member

Given that most people should be using constrained_layout nowadys, and that tight_layout has other shortcomings as well, I think that changing the behavior - even if it means improving - is not worth it. Those who are using tight_layout are likely ok with the existing behavior. Those who want a better layout engine should switch to constrained_layout.

I therefore propose to close this.

scottshambaugh reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
topic: geometry managerLayoutEngine, Constrained layout, Tight layout
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@leejjoon@timhoffm@jklymak@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp