8000 Docstring fixes and numpydoc-ifying · matplotlib/matplotlib@eecf1bd · GitHub
[go: up one dir, main page]

Skip to content

Commit eecf1bd

Browse files
committed
Docstring fixes and numpydoc-ifying
1 parent 14c6460 commit eecf1bd

File tree

2 files changed

+42
-35
lines changed

2 files changed

+42
-35
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,48 +1107,54 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
11071107
11081108
Parameters
11091109
----------
1110-
positions : 1D or 2D array-like object.
1110+
positions : 1D or 2D array-like object
11111111
Each value is an event. If *positions* is a 2D array-like, each
11121112
row corresponds to a row or a column of lines (depending on the
11131113
*orientation* parameter).
11141114
1115-
orientation : str [ 'horizontal' (default) | 'vertical' ], optional.
1116-
'horizontal' : the lines will be vertical and arranged in rows.
1117-
'vertical' : the lines will be horizontal and arranged in columns.
1115+
orientation : {'horizontal', 'vertical'}, optional
1116+
1117+
* 'horizontal' : the lines are arranged horizontally in rows,
1118+
and are vertical.
1119+
* 'vertical' : the lines are arranged vertically in columns,
1120+
and are horizontal.
11181121
1119-
lineoffsets : scalar or sequence of scalars, optional. Default is 1.
1120-
The offset of the center of the lines from the origin.
1122+
lineoffsets : scalar or sequence of scalars, optional, default: 1
1123+
The offset of the center of the lines from the origin, in the
1124+
orthogonal direction to *orientation*.
11211125
1122-
linelengths : scalar or sequence of scalars, optional. Default is 1.
1126+
linelengths : scalar or sequence of scalars, optional, default: 1
11231127
The total height of the lines (i.e. the lines stretches from
1124-
``lineoffset + linelength/2`` to ``lineoffset - linelength/2``).
1128+
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
11251129
1126-
linewidths : scalar, scalar sequence or None, optional. Default: None.
1127-
If it is None, defaults to its rcParams setting.
1130+
linewidths : scalar, scalar sequence or None, optional, default: None
1131+
The line width(s) of the event lines, in points. If it is None,
1132+
defaults to its rcParams setting.
11281133
1129-
colors : color, sequence of colors or None, optional. Default is None.
1130-
If it is None, defaults to its rcParams setting.
1134+
colors : color, sequence of colors or None, optional, default: None
1135+
The color(s) of the event lines. If it is None, defaults to its
1136+
rcParams setting.
11311137
1132-
linestyles : str or tuple or a sequence of such values, optional.
1133-
Default is 'solid'. Valid strings are [ 'solid' | 'dashed' |
1134-
'dashdot' | 'dotted' | '-' | '--' | '-.' | ':' ]. Dash tuples
1135-
have to be of the form::
1138+
linestyles : str or tuple or a sequence of such values, optional
1139+
Default is 'solid'. Valid strings are ['solid', 'dashed',
1140+
'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples
1141+
should be of the form::
11361142
11371143
(offset, onoffseq),
11381144
11391145
where *onoffseq* is an even length tuple of on and off ink
11401146
in points.
11411147
1142-
kwargs : optional
1148+
**kwargs : optional
11431149
Other keyword arguments are line collection properties. See
11441150
:class:`~matplotlib.collections.LineCollection` for a list of
11451151
the valid properties.
11461152
11471153
For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only
11481154
a single value is given, that value is applied to all lines. If an
11491155
array-like is given, it must have the same length as positions, and
1150-
each value will be applied to the corresponding row or column in
1151-
positions.
1156+
each value will be applied to the corresponding row or column of
1157+
events.
11521158
11531159
Returns
11541160
-------

lib/matplotlib/collections.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,9 +1243,9 @@ class EventCollection(LineCollection):
12431243
'''
12441244
A collection of discrete events.
12451245
1246-
The events are a 1-dimensional array, usually the position of something
1247-
along an axis, such as time or length. They do not have an amplitude and
1248-
are displayed as vertical or horizontal parallel bars.
1246+
The events are given by a 1-dimensional array, usually the position of
1247+
something along an axis, such as time or length. They do not have an
1248+
amplitude and are displayed as vertical or horizontal parallel bars.
12491249
'''
12501250

12511251
_edge_default = True
@@ -1264,40 +1264,41 @@ def __init__(self,
12641264
"""
12651265
Parameters
12661266
----------
1267-
positions : 1D array-like object.
1267+
positions : 1D array-like object
12681268
Each value is an event.
12691269
1270-
orientation : [ None (default) | 'horizontal' | 'vertical'], optional.
1270+
orientation : {None, 'horizontal', 'vertical'}, optional
12711271
The orientation of the **collection** (the event bars are along
12721272
the orthogonal direction). Defaults to 'horizontal' if not
12731273
specified or None.
12741274
1275-
lineoffset : scalar, optional. Default is 0.
1276-
The offset of the center of the markers from the origin.
1275+
lineoffset : scalar, optional, default: 0
1276+
The offset of the center of the markers from the origin, in the
1277+
orthogonal direction to *orientation*.
12771278
1278-
linelength : scalar, optional. Default is 1.
1279+
linelength : scalar, optional, default: 1
12791280
The total height of the marker (i.e. the marker stretches from
1280-
``lineoffset + linelength/2`` to ``lineoffset - linelength/2``).
1281+
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
12811282
1282-
linewidth : scalar or None, optional. Default is None.
1283+
linewidth : scalar or None, optional, default: None
12831284
If it is None, defaults to its rcParams setting, in sequence form.
12841285
1285-
color : color, sequence of colors or None, optional. Default is None.
1286+
color : color, sequence of colors or None, optional, default: None
12861287
If it is None, defaults to its rcParams setting, in sequence form.
12871288
1288-
linestyle : str or tuple, optional. Default is 'solid'.
1289-
Valid strings are [ 'solid' | 'dashed' | 'dashdot' | 'dotted' |
1290-
'-' | '--' | '-.' | ':' ]. Dash tuples have to be of the form::
1289+
linestyle : str or tuple, optional, default: 'solid'
1290+
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',
1291+
'-', '--', '-.', ':']. Dash tuples should be of the form::
12911292
12921293
(offset, onoffseq),
12931294
12941295
where *onoffseq* is an even length tuple of on and off ink
12951296
in points.
12961297
1297-
antialiased : [None (default) | 1 | 2], optional.
1298+
antialiased : {None, 1, 2}, optional
12981299
If it is None, defaults to its rcParams setting, in sequence form.
12991300
1300-
kwargs : optional
1301+
**kwargs : optional
13011302
Other keyword arguments are line collection properties. See
13021303
:class:`~matplotlib.collections.LineCollection` for a list of
13031304
the valid properties.

0 commit comments

Comments
 (0)
0