seaborn.objects.Plot.layout#

Plot.layout(*, size=<default>, engine=<default>)#

Control the figure size and layout.

Note

Default figure sizes and the API for specifying the figure size are subject to change in future “experimental” releases of the objects API. The default layout engine may also change.

Parameters:
size(width, height)

Size of the resulting figure, in inches. Size is inclusive of legend when using pyplot, but not otherwise.

engine{{“tight”, “constrained”, None}}

Name of method for automatically adjusting the layout to remove overlap. The default depends on whether Plot.on() is used.

Examples

Control the overall dimensions of the figure with size:

p = so.Plot().layout(size=(4, 4))
p
../_images/objects.Plot.layout_1_0.png

Subplots created by using Plot.facet() or Plot.pair() will shrink to fit in the available space:

p.facet(["A", "B"], ["X", "Y"])
../_images/objects.Plot.layout_3_0.png

You may find that different automatic layout engines give better or worse results with specific plots:

p.facet(["A", "B"], ["X", "Y"]).layout(engine="constrained")
../_images/objects.Plot.layout_5_0.png