Skip to content

Commit 596ad4f

Browse files
committed
Improve documentation
1 parent 094f9c4 commit 596ad4f

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

doc/_docstrings/objects.Plot.layout.ipynb

+19-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,28 @@
6969
"p.facet([\"A\", \"B\"], [\"X\", \"Y\"]).layout(engine=\"constrained\")"
7070
]
7171
},
72+
{
73+
"cell_type": "markdown",
74+
"id": "d61054d1-dcef-4e11-9802-394bcc633f9f",
75+
"metadata": {},
76+
"source": [
77+
"With `extent`, you can control the size of the plot relative to the underlying figure. Because the notebook display adapts the figure background to the plot, this appears only to change the plot size in a notebook context. But it can be useful when saving or displaying through a `pyplot` GUI window:"
78+
]
79+
},
80+
{
81+
"cell_type": "code",
82+
"execution_count": null,
83+
"id": "1b5d5969-2925-474f-8e3c-99e4f90a7a2b",
84+
"metadata": {},
85+
"outputs": [],
86+
"source": [
87+
"p.layout(extent=[0, 0, .8, 1]).show()"
88+
]
89+
},
7290
{
7391
"cell_type": "code",
7492
"execution_count": null,
75-
"id": "781ff58c-b805-4e93-8cae-be0442e273ea",
93+
"id": "e5c41b7d-a064-4406-8571-a544b194f3dc",
7694
"metadata": {},
7795
"outputs": [],
7896
"source": []

seaborn/_core/plot.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -826,13 +826,14 @@ def layout(
826826
size : (width, height)
827827
Size of the resulting figure, in inches. Size is inclusive of legend when
828828
using pyplot, but not otherwise.
829-
engine : {{"tight", "constrained", None}}
829+
engine : {{"tight", "constrained", "none"}}
830830
Name of method for automatically adjusting the layout to remove overlap.
831831
The default depends on whether :meth:`Plot.on` is used.
832832
extent : (left, bottom, right, top)
833-
Boundaries of the plot layout, in fractions of the figure size.
834-
Note: the extent includes of axis decorations when using a layout engine,
835-
but it is exclusive when `engine=None`.
833+
Boundaries of the plot layout, in fractions of the figure size. Takes
834+
effect through the layout engine; exact results will vary across engines.
835+
Note: the extent includes axis decorations when using a layout engine,
836+
but it is exclusive of them when `engine="none"`.
836837
837838
Examples
838839
--------

0 commit comments

Comments
 (0)