Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf09849

Browse files
committed
DOC merged sharex/y in subplots docstrings
1 parent a1e7282 commit cf09849

File tree

2 files changed

+30
-50
lines changed

2 files changed

+30
-50
lines changed

lib/matplotlib/figure.py

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,31 +1028,21 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
10281028
nrows, ncols : int, default: 1
10291029
Number of rows/cols of the subplot grid.
10301030
1031-
sharex : {"none", "all", "row", "col"} or bool, default: False
1032-
- If True, the x-axis will be shared amongst all subplots.
1033-
- If False, no x-axis will be shared amongst subplots.
1034-
- If a string must be one of "row", "col", "all", or "none".
1035-
- "all" has the same effect as True.
1036-
- "none" has the same effect as False.
1037-
- If "row", each subplot row will share an x-axis.
1038-
- If "col", each subplot column will share an x-axis.
1039-
1040-
Note that if the x-axis is shared across rows (sharex=True or
1041-
sharex="col"), then the x tick labels will only be display on
1042-
subplots of the bottom row.
1043-
1044-
sharey : {"none", "all", "row", "col"} or bool, default: False
1045-
- If True, the y-axis will be shared amongst all subplots.
1046-
- If False, no y-axis will be shared amongst subplots.
1047-
- If a string must be one of "row", "col", "all", or "none".
1048-
- "all" has the same effect as True.
1049-
- "none" has the same effect as False.
1050-
- If "row", each subplot row will share a y-axis.
1051-
- If "col", each subplot column will share an y-axis
1052-
1053-
Note that if the y-axis is shared across columns (sharey=True or
1054-
sharey="col"), then the y tick labels will only be displayed on
1055-
subplots of the first column.
1031+
sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
1032+
Controls sharing of properties among x (`sharex`) or y (`sharey`)
1033+
axes:
1034+
1035+
- True or 'all': x- or y-axis will be shared among all
1036+
subplots.
1037+
- False or 'none': each subplot x- or y-axis will be
1038+
independent.
1039+
- 'row': each subplot row will share an x- or y-axis.
1040+
- 'col': each subplot column will share an x- or y-axis.
1041+
1042+
When subplots have a shared x-axis along a column, only the x tick
1043+
labels of the bottom subplot are visible. Similarly, when
1044+
subplots have a shared y-axis along a row, only the y tick labels
1045+
of the first column subplot are visible.
10561046
10571047
squeeze : bool, default: True
10581048
- If True, extra dimensions are squeezed out from the returned

lib/matplotlib/pyplot.py

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,31 +1050,21 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10501050
nrows, ncols : int, optional, default: 1
10511051
Number of rows/columns of the subplot grid.
10521052
1053-
sharex : {"none", "all", "row", "col"} or bool, default: False
1054-
- If True, the x-axis will be shared amongst all subplots.
1055-
- If False, no x-axis will be shared amongst subplots.
1056-
- If a string must be one of "row", "col", "all", or "none".
1057-
- "all" has the same effect as True.
1058-
- "none" has the same effect as False.
1059-
- If "row", each subplot row will share an x-axis.
1060-
- If "col", each subplot column will share an x-axis.
1061-
1062-
Note that if the x-axis is shared across rows (sharex=True or
1063-
sharex="col"), then the x tick labels will only be display on subplots
1064-
of the bottom row.
1065-
1066-
sharey : {"none", "all", "row", "col"} or bool, default: False
1067-
- If True, the y-axis will be shared amongst all subplots.
1068-
- If False, no y-axis will be shared amongst subplots.
1069-
- If a string must be one of "row", "col", "all", or "none".
1070-
- "all" has the same effect as True.
1071-
- "none" has the same effect as False.
1072-
- If "row", each subplot row will share a y-axis.
1073-
- If "col", each subplot column will share an y-axis
1074-
1075-
Note that if the y-axis is shared across columns (sharey=True or
1076-
sharey="col"), then the y tick labels will only be displayed on
1077-
subplots of the first column.
1053+
sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
1054+
Controls sharing of properties among x (`sharex`) or y (`sharey`)
1055+
axes:
1056+
1057+
- True or 'all': x- or y-axis will be shared among all
1058+
subplots.
1059+
- False or 'none': each subplot x- or y-axis will be
1060+
independent.
1061+
- 'row': each subplot row will share an x- or y-axis.
1062+
- 'col': each subplot column will share an x- or y-axis.
1063+
1064+
When subplots have a shared x-axis along a column, only the x tick
1065+
labels of the bottom subplot are visible. Similarly, when subplots
1066+
have a shared y-axis along a row, only the y tick labels of the first
1067+
column subplot are visible.
10781068
10791069
squeeze : bool, optional, default: True
10801070
- If True, extra dimensions are squeezed out from the returned Axes

0 commit comments

Comments
 (0)