Skip to content

[Doc] consolidate rect documentation #22820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/matplotlib/_tight_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def _auto_adjust_subplotpars(
h_pad, w_pad : float
Padding (height/width) between edges of adjacent subplots, as a
fraction of the font size. Defaults to *pad*.
rect : tuple[float, float, float, float]
[left, bottom, right, top] in normalized (0, 1) figure coordinates.
rect : tuple
(left, bottom, right, top), default: None.
"""
rows, cols = shape

Expand Down Expand Up @@ -183,8 +183,8 @@ def auto_adjust_subplotpars(
h_pad, w_pad : float
Padding (height/width) between edges of adjacent subplots, as a
fraction of the font size. Defaults to *pad*.
rect : tuple[float, float, float, float]
[left, bottom, right, top] in normalized (0, 1) figure coordinates.
rect : tuple
(left, bottom, right, top), default: None.
"""
nrows, ncols = nrows_ncols
span_pairs = []
Expand Down Expand Up @@ -262,8 +262,8 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
h_pad, w_pad : float
Padding (height/width) between edges of adjacent subplots. Defaults to
*pad*.
rect : tuple[float, float, float, float], optional
(left, bottom, right, top) rectangle in normalized figure coordinates
rect : tuple (left, bottom, right, top), default: None.
rectangle in normalized figure coordinates
that the whole subplots area (including labels) will fit into.
Defaults to using the entire figure.

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def __init__(self, fig, rect,
fig : `~matplotlib.figure.Figure`
The Axes is built in the `.Figure` *fig*.

rect : [left, bottom, width, height]
rect : tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in
`.Figure` coordinates.

Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ def add_axes(self, *args, **kwargs):

Parameters
----------
rect : sequence of float
The dimensions [left, bottom, width, height] of the new Axes. All
rect : tuple (left, bottom, width, height)
The dimensions (left, bottom, width, height) of the new Axes. All
quantities are in fractions of figure width and height.

projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ def tight_layout(self, figure, renderer=None,
h_pad, w_pad : float, optional
Padding (height/width) between edges of adjacent subplots.
Defaults to *pad*.
rect : tuple of 4 floats, default: (0, 0, 1, 1), i.e. the whole figure
rect : tuple (left, bottom, right, top), default: None
(left, bottom, right, top) rectangle in normalized figure
coordinates that the whole subplots area (including labels) will
fit into.
fit into. Default (None) is the whole figure.
"""

subplotspec_list = _tight_layout.get_subplotspec_list(
Expand Down
7 changes: 3 additions & 4 deletions lib/matplotlib/layout_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ def __init__(self, *, pad=1.08, h_pad=None, w_pad=None,
h_pad, w_pad : float
Padding (height/width) between edges of adjacent subplots.
Defaults to *pad*.
rect : tuple of 4 floats, optional
(left, bottom, right, top) rectangle in normalized figure
coordinates that the subplots (including labels)
will fit into. Defaults to using the entire figure.
rect : tuple (left, bottom, right, top), default: (0, 0, 1, 1).
rectangle in normalized figure coordinates that the subplots
(including labels) will fit into.
"""
super().__init__(**kwargs)
for td in ['pad', 'h_pad', 'w_pad', 'rect']:
Expand Down
2 changes: 1 addition & 1 deletion lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(
----------
fig : Figure
The parent figure.
rect : (float, float, float, float)
rect : tuple (left, bottom, width, height), default: None.
The ``(left, bottom, width, height)`` axes position.
elev : float, default: 30
The elevation angle in degrees rotates the camera above and below
Expand Down