Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Dec 9, 2023
1 parent 094f9c4 commit 596ad4f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
20 changes: 19 additions & 1 deletion doc/_docstrings/objects.Plot.layout.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,28 @@
"p.facet([\"A\", \"B\"], [\"X\", \"Y\"]).layout(engine=\"constrained\")"
]
},
{
"cell_type": "markdown",
"id": "d61054d1-dcef-4e11-9802-394bcc633f9f",
"metadata": {},
"source": [
"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:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1b5d5969-2925-474f-8e3c-99e4f90a7a2b",
"metadata": {},
"outputs": [],
"source": [
"p.layout(extent=[0, 0, .8, 1]).show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "781ff58c-b805-4e93-8cae-be0442e273ea",
"id": "e5c41b7d-a064-4406-8571-a544b194f3dc",
"metadata": {},
"outputs": [],
"source": []
Expand Down
9 changes: 5 additions & 4 deletions seaborn/_core/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,13 +826,14 @@ def layout(
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}}
engine : {{"tight", "constrained", "none"}}
Name of method for automatically adjusting the layout to remove overlap.
The default depends on whether :meth:`Plot.on` is used.
extent : (left, bottom, right, top)
Boundaries of the plot layout, in fractions of the figure size.
Note: the extent includes of axis decorations when using a layout engine,
but it is exclusive when `engine=None`.
Boundaries of the plot layout, in fractions of the figure size. Takes
effect through the layout engine; exact results will vary across engines.
Note: the extent includes axis decorations when using a layout engine,
but it is exclusive of them when `engine="none"`.
Examples
--------
Expand Down

0 comments on commit 596ad4f

Please sign in to comment.