@@ -1091,55 +1091,83 @@ 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).
1112
1114
1113
- *lineoffsets* :
1114
- A float or array-like containing floats.
1115
+ orientation : {'horizontal', 'vertical'}, optional
1116
+ Controls the direction of the event collections:
1115
1117
1116
- *linelengths* :
1117
- A float or array-like containing floats.
1118
+ - 'horizontal' : the lines are arranged horizontally in rows,
1119
+ and are vertical.
1120
+ - 'vertical' : the lines are arranged vertically in columns,
1121
+ and are horizontal.
1118
1122
1119
- *linewidths* :
1120
- A float or array-like containing floats.
1123
+ lineoffsets : scalar or sequence of scalars, optional, default: 1
1124
+ The offset of the center of the lines from the origin, in the
1125
+ direction orthogonal to *orientation*.
1121
1126
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
1127
+ linelengths : scalar or sequence of scalars, optional, default: 1
1128
+ The total height of the lines (i.e. the lines stretches from
1129
+ ``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
1125
1130
1126
- *linestyles* :
1127
- [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ] or an array of these
1128
- values
1131
+ linewidths : scalar, scalar sequence or None, optional, default: None
1132
+ The line width(s) of the event lines, in points. If it is None,
1133
+ defaults to its rcParams setting.
1129
1134
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.
1135
+ colors : color, sequence of colors or None, optional, default: None
1136
+ The color(s) of the event lines. If it is None, defaults to its
1137
+ rcParams setting.
1134
1138
1135
- Returns a list of :class:`matplotlib.collections.EventCollection`
1136
- objects that were added.
1139
+ linestyles : str or tuple or a sequence of such values, optional
1140
+ Default is 'solid'. Valid strings are ['solid', 'dashed',
1141
+ 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples
1142
+ should be of the form::
1137
1143
1138
- kwargs are :class:`~matplotlib.collections.LineCollection` properties:
1144
+ (offset, onoffseq),
1139
1145
1140
- %(LineCollection)s
1146
+ where *onoffseq* is an even length tuple of on and off ink
1147
+ in points.
1141
1148
1142
- **Example:**
1149
+ **kwargs : optional
1150
+ Other keyword arguments are line collection properties. See
1151
+ :class:`~matplotlib.collections.LineCollection` for a list of
1152
+ the valid properties.
1153
+
1154
+ Returns
1155
+ -------
1156
+
1157
+ A list of :class:`matplotlib.collections.EventCollection` objects that
1158
+ were added.
1159
+
1160
+ Notes
1161
+ -----
1162
+
1163
+ For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only
1164
+ a single value is given, that value is applied to all lines. If an
1165
+ array-like is given, it must have the same length as *positions*, and
1166
+ each value will be applied to the corresponding row or column of
1167
+ events.
1168
+
1169
+ Example
1170
+ -------
1143
1171
1144
1172
.. plot:: mpl_examples/pylab_examples/eventplot_demo.py
1145
1173
"""
0 commit comments