@@ -1091,55 +1091,72 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1091
1091
linelengths = 1 , linewidths = None , colors = None ,
1092
1092
linestyles = 'solid' , ** kwargs ):
1093
1093
"""
1094
- Plot identical parallel lines at specific positions.
1094
+ Plot identical parallel lines at the given positions.
1095
1095
1096
- Plot parallel lines at the given positions. positions should be a 1D
1097
- or 2D array-like object, with each row corresponding to a row or column
1098
- of lines.
1096
+ *positions* should be a 1D or 2D array-like object, with each row
1097
+ corresponding to a row or column of lines.
1099
1098
1100
1099
This type of plot is commonly used in neuroscience for representing
1101
- neural events, where it is commonly called a spike raster, dot raster,
1100
+ neural events, where it is usually called a spike raster, dot raster,
1102
1101
or raster plot.
1103
1102
1104
1103
However, it is useful in any situation where you wish to show the
1105
1104
timing or position of multiple sets of discrete events, such as the
1106
1105
arrival times of people to a business on each day of the month or the
1107
1106
date of hurricanes each year of the last century.
1108
1107
1109
- *orientation* : [ 'horizontal' | 'vertical' ]
1110
- 'horizontal' : the lines will be vertical and arranged in rows
1111
- 'vertical' : lines will be horizontal and arranged in columns
1108
+ Parameters
1109
+ ----------
1110
+ positions : 1D or 2D array-like object.
1111
+ Each value is an event. If *positions* is a 2D array-like, each
1112
+ row corresponds to a row or a column of lines (depending on the
1113
+ *orientation* parameter).
1114
+
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.
1112
1118
1113
- * lineoffsets* :
1114
- A float or array-like containing floats .
1119
+ lineoffsets : scalar or sequence of scalars, optional. Default is 1.
1120
+ The offset of the center of the lines from the origin .
1115
1121
1116
- *linelengths* :
1117
- A float or array-like containing floats.
1122
+ linelengths : scalar or sequence of scalars, optional. Default is 1.
1123
+ The total height of the lines (i.e. the lines stretches from
1124
+ ``lineoffset + linelength/2`` to ``lineoffset - linelength/2``).
1118
1125
1119
- * linewidths* :
1120
- A float or array-like containing floats .
1126
+ linewidths : scalar, scalar sequence or None, optional. Default: None.
1127
+ If it is None, defaults to its rcParams setting .
1121
1128
1122
- *colors*
1123
- must be a sequence of RGBA tuples (e.g., arbitrary color
1124
- strings, etc, not allowed) or a list of such sequences
1129
+ colors : color, sequence of colors or None, optional. Default is None.
1130
+ If it is None, defaults to its rcParams setting.
1125
1131
1126
- *linestyles* :
1127
- [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ] or an array of these
1128
- values
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 follow::
1129
1136
1130
- For linelengths, linewidths, colors, and linestyles, if only a single
1131
- value is given, that value is applied to all lines. If an array-like
1132
- is given, it must have the same length as positions, and each value
1133
- will be applied to the corresponding row or column in positions.
1137
+ (offset, onoffseq),
1134
1138
1135
- Returns a list of :class:`matplotlib.collections.EventCollection`
1136
- objects that were added.
1139
+ where *onoffseq* is an even length tuple of on and off ink
1140
+ in points.
1141
+
1142
+ For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only
1143
+ a single value is given, that value is applied to all lines. If an
1144
+ array-like is given, it must have the same length as positions, and
1145
+ each value will be applied to the corresponding row or column in
1146
+ positions.
1137
1147
1138
1148
kwargs are :class:`~matplotlib.collections.LineCollection` properties:
1139
1149
1140
1150
%(LineCollection)s
1141
1151
1142
- **Example:**
1152
+ Returns
1153
+ -------
1154
+
1155
+ A list of :class:`matplotlib.collections.EventCollection` objects that
1156
+ were added.
1157
+
1158
+ Example
1159
+ -------
1143
1160
1144
1161
.. plot:: mpl_examples/pylab_examples/eventplot_demo.py
1145
1162
"""
0 commit comments