Skip to content

[Bug]: Cannot toggle set_tight_layout #22847

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

Closed
richardsheridan opened this issue Apr 14, 2022 · 0 comments · Fixed by #24924
Closed

[Bug]: Cannot toggle set_tight_layout #22847

richardsheridan opened this issue Apr 14, 2022 · 0 comments · Fixed by #24924
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout
Milestone

Comments

@richardsheridan
Copy link
Contributor

richardsheridan commented Apr 14, 2022

Bug summary

As of #20426 calling Figure.set_tight_layout(False) does not disable the tight layout algorithm.

Code for reproduction

from matplotlib import pyplot as plt

fig, ax = plt.subplots()
fig.set_tight_layout(True)
fig.set_tight_layout(False)
assert not fig.get_tight_layout()

Actual outcome

AssertionError

Expected outcome

clean exit

Additional information

I'm pretty sure this branch just needs to set self.set_layout_engine(None) in the falsey case. Attn: @jklymak

Operating system

No response

Matplotlib Version

main

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

@QuLogic QuLogic added this to the v3.6.0 milestone Apr 15, 2022
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Aug 24, 2022
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Jan 10, 2023
Re-uses the tests from matplotlib#22849, but also tests that going _back_ on works
as well.

Fixes matplotlib#22847

Co-authored-by: richardsheridan <richard.sheridan@gmail.com>
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Jan 10, 2023
Re-uses the tests from matplotlib#22849, but also tests that going _back_ on works
as well.

Fixes matplotlib#22847

Co-authored-by: richardsheridan <richard.sheridan@gmail.com>
@QuLogic QuLogic added the topic: geometry manager LayoutEngine, Constrained layout, Tight layout label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout
Projects
None yet
2 participants