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: adjust_bbox should not modify layout engine#24971

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

rcomer
Copy link
Member

@rcomerrcomer commentedJan 13, 2023
edited
Loading

PR Summary

Fixes#24954 (I think!) I don't claim to fully understand everything that's going on here, but it seems to me that these lines are doing the same job as

# we have already done layout above, so turn it off:
stack.enter_context(self.figure._cm_set(layout_engine='none'))

Sincerestore_bbox gets called within the above context manager, the final result is the layout engine continues to be what was set withfig.set_layout_engine(None).

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (andpytest passes)
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • [N/A] New plotting related features are documented with examples.

Release Notes

  • [N/A] New features are marked with a.. versionadded:: directive in the docstring and documented indoc/users/next_whats_new/
  • [N/A] API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • [N/A] Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

@rcomerrcomerforce-pushed theadjust_bbox-layout-engine branch from6e4153c toe93b150CompareJanuary 13, 2023 14:56
@rcomerrcomerforce-pushed theadjust_bbox-layout-engine branch frome93b150 to3c28528CompareJanuary 13, 2023 15:12
@@ -532,6 +532,13 @@ def test_savefig_pixel_ratio(backend):
assert ratio1 == ratio2


def test_savefig_preserve_layout_engine(tmp_path):
Copy link
Member

Choose a reason for hiding this comment

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

This worked before didn't it? It was when the rcParam was set that the problem was? Or was the layout still getting set to None, and then falling back to the rcParam?

Otherwise if this works, I'm all for it! I do wish all the context switching were simpler to debug, but...

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Onmain this test throws anAttributeError because the layout engine got set toNone. If we set the rcParam then we would get an assertion error onmain. I'm happy to test either or both.

@tacaswelltacaswell added this to thev3.7.0 milestoneJan 13, 2023
@tacaswelltacaswell merged commit235b01f intomatplotlib:mainJan 13, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJan 13, 2023
@jklymak
Copy link
Member

Thanks for tracking this down@rcomer ! Great detective work....

@rcomer
Copy link
MemberAuthor

@jklymak thanks to you and@QuLogic for pointing me in the right direction!

oscargus added a commit that referenced this pull requestJan 13, 2023
…971-on-v3.7.xBackport PR#24971 on branch v3.7.x (FIX: adjust_bbox should not modify layout engine)
@rcomerrcomer deleted the adjust_bbox-layout-engine branchJanuary 16, 2023 17:57
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
@rcomerrcomer added the PR: bugfixPull requests that fix identified bugs labelMar 1, 2023
@rcomerrcomer mentioned this pull requestMar 19, 2023
1 task
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Labels
PR: bugfixPull requests that fix identified bugs
Projects
None yet
Milestone
v3.7.0
Development

Successfully merging this pull request may close these issues.

[Bug]: compressed layout setting can be forgotten on second save
3 participants
@rcomer@jklymak@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp