matplotlib.figure.Figure.set_layout_engine#

Figure.set_layout_engine(layout=None,**kwargs)[source]#

Set the layout engine for this figure.

Parameters:
layout{'constrained', 'compressed', 'tight', 'none',LayoutEngine, None}

If aLayoutEngine instance, that instance will be used.

IfNone, the behavior is controlled byrcParams["figure.autolayout"] (default:False)(which ifTrue behaves as if 'tight' was passed) andrcParams["figure.constrained_layout.use"] (default:False) (which ifTrue behaves as if'constrained' was passed). If both areTrue,rcParams["figure.autolayout"] (default:False) takes priority.

Users and libraries can define their own layout engines and passthe instance directly as well.

**kwargs

The keyword arguments are passed to the layout engine to set thingslike padding and margin sizes. Only used iflayout is a string.

Examples usingmatplotlib.figure.Figure.set_layout_engine#

Constrained layout guide

Constrained layout guide