Skip to content

Commit 1207944

Browse files
committed
Improve documentation
1 parent cce3f45 commit 1207944

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

doc/_docstrings/objects.Plot.layout.ipynb

Lines changed: 19 additions & 1 deletion
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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,14 @@ def layout(
831831
size : (width, height)
832832
Size of the resulting figure, in inches. Size is inclusive of legend when
833833
using pyplot, but not otherwise.
834-
engine : {{"tight", "constrained", None}}
834+
engine : {{"tight", "constrained", "none"}}
835835
Name of method for automatically adjusting the layout to remove overlap.
836836
The default depends on whether :meth:`Plot.on` is used.
837837
extent : (left, bottom, right, top)
838-
Boundaries of the plot layout, in fractions of the figure size.
839-
Note: the extent includes of axis decorations when using a layout engine,
840-
but it is exclusive when `engine=None`.
838+
Boundaries of the plot layout, in fractions of the figure size. Takes
839+
effect through the layout engine; exact results will vary across engines.
840+
Note: the extent includes axis decorations when using a layout engine,
841+
but it is exclusive of them when `engine="none"`.
841842
842843
Examples
843844
--------

0 commit comments

Comments
 (0)