Skip to content

Commit 0f4aa6b

Browse files
committed
Reword some docstrings.
For many parameters, reword their description from "Control the foo" or "Specifies the foo" to "The foo", which is just as clear.
1 parent 026dacd commit 0f4aa6b

File tree

5 files changed

+62
-69
lines changed

5 files changed

+62
-69
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,12 +1258,12 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
12581258
*orientation* parameter).
12591259
12601260
orientation : {'horizontal', 'vertical'}, optional
1261-
Controls the direction of the event collections:
1261+
The direction of the event collections:
12621262
1263-
- 'horizontal' : the lines are arranged horizontally in rows,
1264-
and are vertical.
1265-
- 'vertical' : the lines are arranged vertically in columns,
1266-
and are horizontal.
1263+
- 'horizontal': the lines are arranged horizontally in rows,
1264+
and are vertical.
1265+
- 'vertical': the lines are arranged vertically in columns,
1266+
and are horizontal.
12671267
12681268
lineoffsets : scalar or sequence of scalars, optional, default: 1
12691269
The offset of the center of the lines from the origin, in the
@@ -2910,7 +2910,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
29102910
textprops : dict, optional, default: None
29112911
Dict of arguments to pass to the text objects.
29122912
2913-
center : list of float, optional, default: (0, 0)
2913+
center : list of float, optional, default: (0, 0)
29142914
Center position of the chart. Takes value (0, 0) or is a sequence
29152915
of 2 scalars.
29162916
@@ -3492,7 +3492,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
34923492
x : Array or a sequence of vectors.
34933493
The input data.
34943494
3495-
notch : bool, optional (False)
3495+
notch : bool, optional, default: False
34963496
If `True`, will produce a notched box plot. Otherwise, a
34973497
rectangular boxplot is produced. The notches represent the
34983498
confidence interval (CI) around the median. See the entry
@@ -3514,9 +3514,9 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
35143514
fliers default to 'b+' If you want more control use the
35153515
flierprops kwarg.
35163516
3517-
vert : bool, optional (True)
3518-
If `True` (default), makes the boxes vertical. If `False`,
3519-
everything is drawn horizontally.
3517+
vert : bool, optional, default: True
3518+
If `True`, draws vertical boxes.
3519+
If `False`, draw horizontal boxes.
35203520
35213521
whis : float or (float, float) (default = 1.5)
35223522
The position of the whiskers.
@@ -3576,55 +3576,55 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
35763576
sequence. The default is 0.5, or ``0.15*(distance between
35773577
extreme positions)``, if that is smaller.
35783578
3579-
patch_artist : bool, optional (False)
3579+
patch_artist : bool, optional, default: False
35803580
If `False` produces boxes with the Line2D artist. Otherwise,
35813581
boxes and drawn with Patch artists.
35823582
35833583
labels : sequence, optional
35843584
Labels for each dataset. Length must be compatible with
35853585
dimensions of ``x``.
35863586
3587-
manage_ticks : bool, optional (True)
3587+
manage_ticks : bool, optional, default: True
35883588
If True, the tick locations and labels will be adjusted to match
35893589
the boxplot positions.
35903590
3591-
autorange : bool, optional (False)
3591+
autorange : bool, optional, default: False
35923592
When `True` and the data are distributed such that the 25th and
35933593
75th percentiles are equal, ``whis`` is set to (0, 100) such
35943594
that the whisker ends are at the minimum and maximum of the data.
35953595
3596-
meanline : bool, optional (False)
3596+
meanline : bool, optional, default: False
35973597
If `True` (and ``showmeans`` is `True`), will try to render
35983598
the mean as a line spanning the full width of the box
35993599
according to ``meanprops`` (see below). Not recommended if
36003600
``shownotches`` is also True. Otherwise, means will be shown
36013601
as points.
36023602
3603-
zorder : scalar, optional (None)
3603+
zorder : scalar, optional, default: None
36043604
Sets the zorder of the boxplot.
36053605
36063606
Other Parameters
36073607
----------------
3608-
showcaps : bool, optional (True)
3608+
showcaps : bool, optional, default: True
36093609
Show the caps on the ends of whiskers.
3610-
showbox : bool, optional (True)
3610+
showbox : bool, optional, default: True
36113611
Show the central box.
3612-
showfliers : bool, optional (True)
3612+
showfliers : bool, optional, default: True
36133613
Show the outliers beyond the caps.
3614-
showmeans : bool, optional (False)
3614+
showmeans : bool, optional, default: False
36153615
Show the arithmetic means.
3616-
capprops : dict, optional (None)
3617-
Specifies the style of the caps.
3618-
boxprops : dict, optional (None)
3619-
Specifies the style of the box.
3620-
whiskerprops : dict, optional (None)
3621-
Specifies the style of the whiskers.
3622-
flierprops : dict, optional (None)
3623-
Specifies the style of the fliers.
3624-
medianprops : dict, optional (None)
3625-
Specifies the style of the median.
3626-
meanprops : dict, optional (None)
3627-
Specifies the style of the mean.
3616+
capprops : dict, optional, default: None
3617+
The style of the caps.
3618+
boxprops : dict, optional, default: None
3619+
The style of the box.
3620+
whiskerprops : dict, optional, default: None
3621+
The style of the whiskers.
3622+
flierprops : dict, optional, default: None
3623+
The style of the fliers.
3624+
medianprops : dict, optional, default: None
3625+
The style of the median.
3626+
meanprops : dict, optional, default: None
3627+
The style of the mean.
36283628
36293629
Returns
36303630
-------
@@ -5497,9 +5497,9 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
54975497
This parameter is ignored for RGB(A) data.
54985498
54995499
aspect : {'equal', 'auto'} or float, optional
5500-
Controls the aspect ratio of the axes. The aspect is of particular
5501-
relevance for images since it may distort the image, i.e. pixel
5502-
will not be square.
5500+
The aspect ratio of the axes. This parameter is particularly
5501+
relevant for images since it determines whether data pixels are
5502+
square.
55035503
55045504
This parameter is a shortcut for explicitly calling
55055505
`.Axes.set_aspect`. See there for further details.
@@ -6504,7 +6504,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
65046504
Default is 'bar'
65056505
65066506
align : {'left', 'mid', 'right'}, optional
6507-
Controls how the histogram is plotted.
6507+
The horizontal alignment of the histogram bars.
65086508
65096509
- 'left': bars are centered on the left bin edges.
65106510
- 'mid': bars are centered between the bin edges.
@@ -7682,11 +7682,10 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
76827682
matrices and images.
76837683
If not given, :rc:`image.origin` is used, defaulting to 'upper'.
76847684
7685-
7686-
aspect : {'equal', 'auto', None} or float, optional
7687-
Controls the aspect ratio of the axes. The aspect is of particular
7688-
relevance for images since it may distort the image, i.e. pixel
7689-
will not be square.
7685+
aspect : {'equal', 'auto', None} or float, optional, default: 'equal'
7686+
The aspect ratio of the axes. This parameter is particularly
7687+
relevant for images since it determines whether data pixels are
7688+
square.
76907689
76917690
This parameter is a shortcut for explicitly calling
76927691
`.Axes.set_aspect`. See there for further details.
@@ -7697,8 +7696,6 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
76977696
non-square pixels.
76987697
- *None*: Use :rc:`image.aspect`.
76997698
7700-
Default: 'equal'
7701-
77027699
Returns
77037700
-------
77047701
ret : `~matplotlib.image.AxesImage` or `.Line2D`

lib/matplotlib/mlab.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,11 @@ def detrend(x, key=None, axis=None):
152152
Array or sequence containing the data.
153153
154154
key : {'default', 'constant', 'mean', 'linear', 'none'} or function
155-
Specifies the detrend algorithm to use. 'default' is 'mean', which is
156-
the same as `detrend_mean`. 'constant' is the same. 'linear' is
157-
the same as `detrend_linear`. 'none' is the same as
158-
`detrend_none`. The default is 'mean'. See the corresponding
159-
functions for more details regarding the algorithms. Can also be a
160-
function that carries out the detrend operation.
155+
The detrending algorithm to use. 'default', 'mean', and 'constant' are
156+
the same as `detrend_mean`. 'linear' is the same as `detrend_linear`.
157+
'none' is the same as `detrend_none`. The default is 'mean'. See the
158+
corresponding functions for more details regarding the algorithms. Can
159+
also be a function that carries out the detrend operation.
161160
162161
axis : integer
163162
The axis along which to do the detrending.
@@ -629,10 +628,9 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None,
629628
version of the segment.
630629
631630
sides : {'default', 'onesided', 'twosided'}
632-
Specifies which sides of the spectrum to return. Default gives the
633-
default behavior, which returns one-sided for real data and both
634-
for complex data. 'onesided' forces the return of a one-sided
635-
spectrum, while 'twosided' forces two-sided.
631+
Which sides of the spectrum to return. 'default' is one-sided for real
632+
data and two-sided for complex data. 'onesided' forces the return of a
633+
one-sided spectrum, while 'twosided' forces two-sided.
636634
"""))
637635

638636

@@ -676,10 +674,10 @@ def _single_spectrum_helper(x, mode, Fs=None, window=None, pad_to=None,
676674
'linear' calls `.detrend_linear`.
677675
678676
scale_by_freq : bool, optional
679-
Specifies whether the resulting density values should be scaled
680-
by the scaling frequency, which gives density in units of Hz^-1.
681-
This allows for integration over the returned frequency values.
682-
The default is True for MATLAB compatibility.
677+
Whether the resulting density values should be scaled by the scaling
678+
frequency, which gives density in units of Hz^-1. This allows for
679+
integration over the returned frequency values. The default is True
680+
for MATLAB compatibility.
683681
"""))
684682

685683

lib/matplotlib/quiver.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -868,18 +868,16 @@ def _h_arrows(self, length):
868868
start of the barb that many points away from grid point.
869869
870870
barbcolor : color or color sequence
871-
Specifies the color of all parts of the barb except for the flags. This
872-
parameter is analogous to the *edgecolor* parameter for polygons,
873-
which can be used instead. However this parameter will override
874-
facecolor.
871+
The color of all parts of the barb except for the flags. This parameter
872+
is analogous to the *edgecolor* parameter for polygons, which can be used
873+
instead. However this parameter will override facecolor.
875874
876875
flagcolor : color or color sequence
877-
Specifies the color of any flags on the barb. This parameter is
878-
analogous to the *facecolor* parameter for polygons, which can be
879-
used instead. However, this parameter will override facecolor. If
880-
this is not set (and *C* has not either) then *flagcolor* will be
881-
set to match *barbcolor* so that the barb has a uniform color. If
882-
*C* has been set, *flagcolor* has no effect.
876+
The color of any flags on the barb. This parameter is analogous to the
877+
*facecolor* parameter for polygons, which can be used instead. However,
878+
this parameter will override facecolor. If this is not set (and *C* has
879+
not either) then *flagcolor* will be set to match *barbcolor* so that the
880+
barb has a uniform color. If *C* has been set, *flagcolor* has no effect.
883881
884882
sizes : dict, optional
885883
A dictionary of coefficients specifying the ratio of a given

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
The ``plot`` directive supports the following options:
4747
4848
format : {'python', 'doctest'}
49-
Specify the format of the input
49+
The format of the input.
5050
5151
include-source : bool
5252
Whether to display the source code. The default can be changed
53-
using the `plot_include_source` variable in conf.py
53+
using the `plot_include_source` variable in :file:`conf.py`.
5454
5555
encoding : str
5656
If this source file is in a non-UTF8 or non-ASCII encoding, the

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,7 @@ def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):
29072907
fig : :class:`~matplotlib.figure.Figure`, optional, default: None
29082908
Current figure. It can be None if *units* are 'dots'.
29092909
x, y : float, optional, default: 0.0
2910-
Specifies the offset to apply.
2910+
The offset to apply.
29112911
units : {'inches', 'points', 'dots'}, optional
29122912
Units of the offset.
29132913

0 commit comments

Comments
 (0)