Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Doc] Improve set_layout_engine docs #26636

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

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@ def __init__(self,

- 'tight': Use the tight layout mechanism. This is a relatively
simple algorithm that adjusts the subplot parameters so that
decorations do not overlap. See `.Figure.set_tight_layout` for
decorations do not overlap. See `.set_tight_layout` for
further details.

- 'none': Do not use a layout engine.
Expand Down Expand Up @@ -2618,8 +2618,7 @@ def set_layout_engine(self, layout=None, **kwargs):

Parameters
----------
layout: {'constrained', 'compressed', 'tight', 'none'} or \
`LayoutEngine` or None
layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, None}

- 'constrained' will use `~.ConstrainedLayoutEngine`
- 'compressed' will also use `~.ConstrainedLayoutEngine`, but with
Expand All @@ -2628,6 +2627,8 @@ def set_layout_engine(self, layout=None, **kwargs):
- 'tight' uses `~.TightLayoutEngine`
- 'none' removes layout engine.

If a `.LayoutEngine` instance, that instance will be used.

If `None`, the behavior is controlled by :rc:`figure.autolayout`
(which if `True` behaves as if 'tight' was passed) and
:rc:`figure.constrained_layout.use` (which if `True` behaves as if
Expand All @@ -2637,7 +2638,7 @@ def set_layout_engine(self, layout=None, **kwargs):
Users and libraries can define their own layout engines and pass
the instance directly as well.

kwargs: dict
**kwargs
The keyword arguments are passed to the layout engine to set things
like padding and margin sizes. Only used if *layout* is a string.

Expand Down