8000 FIX comments · matplotlib/matplotlib@54d422a · GitHub
[go: up one dir, main page]

Skip to content

Commit 54d422a

Browse files
committed
FIX comments
1 parent da9829f commit 54d422a

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

lib/matplotlib/pyplot.py

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ def subplot(*args, **kwargs):
10401040
def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10411041
subplot_kw=None, gridspec_kw=None, **fig_kw):
10421042
"""
1043-
Create a figure with a set of subplots already made.
1043+
Create a figure and a set of subplots
10441044
10451045
This utility wrapper makes it convenient to create common layouts of
10461046
subplots, including the enclosing figure object, in a single call.
@@ -1054,30 +1054,30 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10541054
Number of columns of the subplot grid.
10551055
10561056
sharex : bool or string, optional, default: False
1057-
- If True, the X axis will be shared amongst all subplots. Note that
1058-
if nrows > 1 then the x tick labels won't be displayed on any of
1059-
plots but the ones on the bottom row.
1057+
- If True, the X axis will be shared amongst all subplots.
10601058
- If False, no axis will be shared amongst subplots.
10611059
- If a string must be one of "row", "col", "all", or "none".
10621060
- "all" has the same effect as True.
10631061
- "none" has the same effect as False.
10641062
- If "row", each subplot row will share a X axis.
1065-
- If "col", each subplot column will share a X axis. Note that if
1066-
nrows > 1 then the x tick labels won't be displayed on any of
1067-
the plots but the ones on the bottom row.
1063+
- If "col", each subplot column will share a X axis.
1064+
1065+
Note that if the x-axis is shared across rows (sharex=True or
1066+
sharex="col") and nrows > 1 then the x tick labels won't be displayed
1067+
on any of plots but the ones on the bottom row.
10681068
10691069
sharey : bool or string, optional, default: False
1070-
- If True, the Y axis will be shared amongst all subplots. Note that
1071-
if ncols > 1 then the y tick labels won't be displayed on any of
1072-
plots but the ones on first column.
1070+
- If True, the Y axis will be shared amongst all subplots.
10731071
- If False, no y-axis will be shared amongst subplots.
10741072
- If a string must be one of "row", "col", "all", or "none".
10751073
- "all" has the same effect as True.
10761074
- "none" has the same effect as False.
10771075
- If "row", each subplot row will share a y-axis.
1078-
- If "col", each subplot column will share a y-axis. Note that if
1079-
ncols > 1 then the y tick labels won't be displayed on any of
1080-
the plots but the ones on the first column.
1076+
- If "col", each subplot column will share a y-axis
1077+
1078+
Note that if the y-axis is shared across columns (sharey=False or
1079+
sharey="col") and ncols > 1 then the y tick labels won't be displayed
1080+
on any of the plots but the ones on the first column.
10811081
10821082
squeeze : bool, optional, default: True
10831083
- If True, extra dimensions are squeezed out from the returned axis
@@ -1111,10 +1111,12 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
11111111
-------
11121112
fig : :class:`matplotlib.figure.Figure` object
11131113
1114-
ax : axis or array of axis objects.
1115-
ax can be either a single axis object or an array of axis objects if
1116-
more than one subplot was created. The dimensions of the resulting
1117-
array can be controlled with the squeeze keyword, see above.
1114+
ax : Axes object or array of Axes objects.
1115+
1116+
ax can be either a single :class:`matplotlib.axes.Axes` object or an
1117+
array of Axes objects if more than one subplot was created. The
1118+
dimensions of the resulting array can be controlled with the squeeze
1119+
keyword, see above.
11181120
11191121
Examples
11201122
--------
@@ -1123,7 +1125,7 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
11231125
>>> x = np.linspace(0, 2*np.pi, 400)
11241126
>>> y = np.sin(x**2)
11251127
1126-
Creates just a figure and only one subplot.
1128+
Creates just a figure and only one subplot
11271129
11281130
>>> fig, ax = plt.subplots()
11291131
>>> ax.plot(x, y)
@@ -1150,13 +1152,18 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
11501152
11511153
>>> plt.subplots(2, 2, sharey='row')
11521154
1153-
Share a X and Y axis with all subplots
1155+
Share both X and Y axes with all subplots
11541156
11551157
>>> plt.subplots(2, 2, sharex='all', sharey='all')
11561158
11571159
Note that this is the same as
11581160
11591161
>>> plt.subplots(2, 2, sharex=True, sharey=True)
1162+
1163+
See Also
1164+
--------
1165+
figure
1166+
subplot
11601167
"""
11611168
fig = figure(**fig_kw)
11621169
axs = fig.subplots(nrows=nrows, ncols=ncols, sharex=sharex, sharey=sharey,

0 commit comments

Comments
 (0)
0