@@ -1007,71 +1007,71 @@ def add_subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
1007
1007
"""
1008
1008
Add a set of subplots to this figure.
1009
1009
1010
- Keyword arguments:
1010
+ Parameters
1011
+ ----------
1012
+ nrows : int, default: 1
1013
+ Number of rows of the subplot grid.
1014
+
1015
+ ncols : int, default: 1
1016
+ Number of columns of the subplot grid.
1017
+
1018
+ sharex : {"none", "all", "row", "col"} or bool, default: False
1019
+ If *False*, or "none", each subplot has its own X axis.
1020
+
1021
+ If *True*, or "all", all subplots will share an X axis, and the x
1022
+ tick labels on all but the last row of plots will be invisible.
1023
+
1024
+ If "col", each subplot column will share an X axis, and the x
1025
+ tick labels on all but the last row of plots will be invisible.
1026
+
1027
+ If "row", each subplot row will share an X axis.
1028
+
1029
+ sharey : {"none", "all", "row", "col"} or bool, default: False
1030
+ If *False*, or "none", each subplot has its own Y axis.
1031
+
1032
+ If *True*, or "all", all subplots will share an Y axis, and the x
1033
+ tick labels on all but the first column of plots will be invisible.
1011
1034
1012
- *nrows* : int
1013
- Number of rows of the subplot grid. Defaults to 1.
1014
-
1015
- *ncols* : int
1016
- Number of columns of the subplot grid. Defaults to 1.
1017
-
1018
- *sharex* : string or bool
1019
- If *True*, the X axis will be shared amongst all subplots. If
1020
- *True* and you have multiple rows, the x tick labels on all but
1021
- the last row of plots will have visible set to *False*
1022
- If a string must be one of "row", "col", "all", or "none".
1023
- "all" has the same effect as *True*, "none" has the same effect
1024
- as *False*.
1025
- If "row", each subplot row will share a X axis.
1026
- If "col", each subplot column will share a X axis and the x tick
1027
- labels on all but the last row will have visible set to *False*.
1028
-
1029
- *sharey* : string or bool
1030
- If *True*, the Y axis will be shared amongst all subplots. If
1031
- *True* and you have multiple columns, the y tick labels on all but
1032
- the first column of plots will have visible set to *False*
1033
- If a string must be one of "row", "col", "all", or "none".
1034
- "all" has the same effect as *True*, "none" has the same effect
1035
- as *False*.
1036
- If "row", each subplot row will share a Y axis and the y tick
1037
- labels on all but the first column will have visible set to *False*.
1038
- If "col", each subplot column will share a Y axis.
1039
-
1040
- *squeeze* : bool
1041
- If *True*, extra dimensions are squeezed out from the
1042
- returned axis object:
1043
-
1044
- - if only one subplot is constructed (nrows=ncols=1), the
1045
- resulting single Axis object is returned as a scalar.
1035
+ If "row", each subplot row will share an Y axis, and the x tick
1036
+ labels on all but the first column of plots will be invisible.
1037
+
1038
+ If "col", each subplot column will share an Y axis.
1039
+
1040
+ squeeze : bool, default: True
1041
+ If *True*, extra dimensions are squeezed out from the returned axes
1042
+ array:
1043
+
1044
+ - if only one subplot is constructed (nrows=ncols=1), the resulting
1045
+ single Axes object is returned as a scalar.
1046
1046
1047
1047
- for Nx1 or 1xN subplots, the returned object is a 1-d numpy
1048
- object array of Axis objects are returned as numpy 1-d
1049
- arrays.
1048
+ object array of Axes objects are returned as numpy 1-d arrays.
1050
1049
1051
- - for NxM subplots with N>1 and M>1 are returned as a 2d
1052
- array.
1050
+ - for NxM subplots with N>1 and M>1 are returned as a 2d array.
1053
1051
1054
- If *False*, no squeezing at all is done: the returned axis
1055
- object is always a 2-d array containing Axis instances, even if it
1056
- ends up being 1x1.
1052
+ If *False*, no squeezing at all is done: the returned axes object
1053
+ is always a 2-d array of Axes instances, even if it ends up being
1054
+ 1x1.
1057
1055
1058
- * subplot_kw* : dict
1056
+ subplot_kw : dict, default: {}
1059
1057
Dict with keywords passed to the
1060
- :meth:`~matplotlib.figure.Figure.add_subplot` call used to
1061
- create each subplots.
1058
+ :meth:`~matplotlib.figure.Figure.add_subplot` call used to create
1059
+ each subplots.
1062
1060
1063
- * gridspec_kw* : dict
1061
+ gridspec_kw : dict, default: {}
1064
1062
Dict with keywords passed to the
1065
1063
:class:`~matplotlib.gridspec.GridSpec` constructor used to create
1066
1064
the grid the subplots are placed on.
1067
1065
1068
- Returns:
1069
-
1070
- ax : single axes object or array of axes objects
1066
+ Returns
1067
+ -------
1068
+ ax : single Axes object or array of Axes objects
1071
1069
The addes axes. The dimensions of the resulting array can be
1072
1070
controlled with the squeeze keyword, see above.
1073
1071
1074
- See the docstring of :func:`~pyplot.subplots' for examples
1072
+ See Also
1073
+ --------
1074
+ pyplot.subplots : pyplot API; docstring includes examples.
1075
1075
"""
1076
1076
1077
1077
# for backwards compatibility
0 commit comments