Skip to content
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

[Bug]: fig.get_constrained_layout_pads() raises AttributeError #25963

Closed
StefRe opened this issue May 24, 2023 · 0 comments · Fixed by #25964
Closed

[Bug]: fig.get_constrained_layout_pads() raises AttributeError #25963

StefRe opened this issue May 24, 2023 · 0 comments · Fixed by #25964
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout
Milestone

Comments

@StefRe
Copy link
Contributor

StefRe commented May 24, 2023

Bug summary

fig.get_constrained_layout_pads() fails because the LayoutEngine has no function get_info().

Code for reproduction

import matplotlib.pyplot as plt

fig = plt.figure(layout='constrained')
print(fig.get_constrained_layout_pads())

Actual outcome

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\programs\mambaforge\lib\site-packages\matplotlib\_api\deprecation.py", line 200, in wrapper
    return func(*args, **kwargs)
  File "c:\programs\mambaforge\lib\site-packages\matplotlib\figure.py", line 2876, in get_constrained_layout_pads
    info = self.get_layout_engine().get_info()
AttributeError: 'ConstrainedLayoutEngine' object has no attribute 'get_info'

Expected outcome

(0.04167, 0.04167, 0.02, 0.02)

Additional information

No response

Operating system

No response

Matplotlib Version

3.7.1

Matplotlib Backend

No response

Python version

3.10.11

Jupyter version

No response

Installation

conda

@melissawm melissawm added the topic: geometry manager LayoutEngine, Constrained layout, Tight layout label May 24, 2023
@QuLogic QuLogic added this to the v3.7.2 milestone May 25, 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
Development

Successfully merging a pull request may close this issue.

3 participants