8000 DOC figure and pyplot's subplot docstring are now identical · matplotlib/matplotlib@20cd16a · GitHub
[go: up one dir, main page]

Skip to content

Commit 20cd16a

Browse files
committed
DOC figure and pyplot's subplot docstring are now identical
1 parent 2c98c6d commit 20cd16a

File tree

2 files changed

+42
-43
lines changed

2 files changed

+42
-43
lines changed

lib/matplotlib/figure.py

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,48 +1025,50 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
10251025
10261026
Parameters
10271027
----------
1028-
nrows : int, default: 1
1029-
Number of rows of the subplot grid.
1030-
1031-
ncols : int, default: 1
1032-
Number of columns of the subplot grid.
1028+
nrows, ncols : int, default: 1
1029+
Number of rows/cols of the subplot grid.
10331030
10341031
sharex : {"none", "all", "row", "col"} or bool, default: False
1035-
If *False*, or "none", each subplot has its own X axis.
1036-
1037-
If *True*, or "all", all subplots will share an X axis, and the x
1038-
tick labels on all but the last row of plots will be invisible.
1039-
1040-
If "col", each subplot column will share an X axis, and the x
1041-
tick labels on all but the last row of plots will be invisible.
1042-
1043-
If "row", each subplot row will share an X axis.
1032+
- If True, the x-axis will be shared amongst all subplots.
1033+
- If False, no 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 a x-axis.
1038+
- If "col", each subplot column will share a 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.
10441043
10451044
sharey : {"none", "all", "row", "col"} or bool, default: False
1046-
If *False*, or "none", each subplot has its own Y axis.
1047-
1048-
If *True*, or "all", all subplots will share an Y axis, and the y
1049-
tick labels on all but the first column of plots will be invisible.
1050-
1051-
If "row", each subplot row will share an Y axis, and the y tick
1052-
labels on all but the first column of plots will be invisible.
1053-
1054-
If "col", each subplot column will share an Y axis.
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 a y-axis
1052+
1053+
Note that if the y-axis is shared across columns (sharey=False or
1054+
sharey="col"), 1 then the y tick labels will only be displayed on
1055+
subplots of the first column.
10551056
10561057
squeeze : bool, default: True
1057-
If *True*, extra dimensions are squeezed out from the returned axes
1058-
array:
1059-
1060-
- if only one subplot is constructed (nrows=ncols=1), the resulting
1061-
single Axes object is returned as a scalar.
1062-
1063-
- for Nx1 or 1xN subplots, the returned object is a 1-d numpy
1064-
object array of Axes objects are returned as numpy 1-d arrays.
1065-
1066-
- for NxM subplots with N>1 and M>1 are returned as a 2d array.
1067-
1068-
If *False*, no squeezing at all is done: the returned object is
1069-
always a 2-d array of Axes instances, even if it ends up being 1x1.
1058+
- If True, extra dimensions are squeezed out from the returned
1059+
axis object:
1060+
1061+
- if only one subplot is constructed (nrows=ncols=1), the
1062+
resulting single Axis object is returned as a scalar.
1063+
- for Nx1 or 1xN subplots, the returned object is a 1-d numpy
1064+
object array of Axis objects are returned as numpy 1-d
1065+
arrays.
1066+
- for NxM subplots with N>1 and M>1 are returned as a 2d
1067+
arrays.
1068+
1069+
- If False, no squeezing at all is done: the returned axis object
1070+
is always a 2-d array containing Axis instances, even if it ends
1071+
up being 1x1.
10701072
10711073
subplot_kw : dict, default: {}
10721074
Dict with keywords passed to the

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,13 +1047,10 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10471047
10481048
Parameters
10491049
----------
1050-
nrows : int, optional, default: 1
1051-
Number of rows of the subplot grid.
1050+
nrows, ncols : int, optional, default: 1
1051+
Number of rows/columns of the subplot grid.
10521052
1053-
ncols : int, optional, default: 1
1054-
Number of columns of the subplot grid.
1055-
1056-
sharex : bool or string, optional, default: False
1053+
sharex : {"none", "all", "row", "col"} or bool, default: False
10571054
- If True, the x-axis will be shared amongst all subplots.
10581055
- If False, no axis will be shared amongst subplots.
10591056
- If a string must be one of "row", "col", "all", or "none".
@@ -1066,7 +1063,7 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10661063
sharex="col"), then the x tick labels will only be display on subplots
10671064
of the bottom row.
10681065
1069-
sharey : bool or string, optional, default: False
1066+
sharey : {"none", "all", "row", "col"} or bool, default: False
10701067
- If True, the y-axis will be shared amongst all subplots.
10711068
- If False, no y-axis will be shared amongst subplots.
10721069
- If a string must be one of "row", "col", "all", or "none".

0 commit comments

Comments
 (0)
0