Skip to content

[Bug]: Cannot toggle set_tight_layout #22847

@richardsheridan

Description

@richardsheridan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: geometry managerLayoutEngine, Constrained layout, Tight layout

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy