@@ -1285,9 +1285,6 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1285
1285
"""
1286
1286
Plot identical parallel lines at the given positions.
1287
1287
1288
- *positions* should be a 1D or 2D array-like object, with each row
1289
- corresponding to a row or column of lines.
1290
-
1291
1288
This type of plot is commonly used in neuroscience for representing
1292
1289
neural events, where it is usually called a spike raster, dot raster,
1293
1290
or raster plot.
@@ -1299,48 +1296,53 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1299
1296
1300
1297
Parameters
1301
1298
----------
1302
- positions : 1D or 2D array-like object
1303
- Each value is an event. If *positions* is a 2D array-like, each
1304
- row corresponds to a row or a column of lines (depending on the
1305
- *orientation* parameter).
1299
+ positions : array-like or list of array-like
1300
+ A 1D array-like defines the positions of one sequence of events.
1301
+
1302
+ Multiple groups of events may be passed as a list of array-likes.
1303
+ Each group can be styled independently by passing lists of values
1304
+ to *lineoffsets*, *linelengths*, *linewidths*, *colors* and
1305
+ *linestyles*.
1306
+
1307
+ Note that *positions* can be a 2D array, but in practice different
1308
+ event groups usually have different counts so that one will use a
1309
+ list of different-length arrays rather than a 2D array.
1306
1310
1307
1311
orientation : {'horizontal', 'vertical'}, default: 'horizontal'
1308
- The direction of the event collections :
1312
+ The direction of the event sequence :
1309
1313
1310
- - 'horizontal': the lines are arranged horizontally in rows,
1311
- and are vertical.
1312
- - 'vertical': the lines are arranged vertically in columns,
1313
- and are horizontal.
1314
+ - 'horizontal': the events are arranged horizontally.
1315
+ The indicator lines are vertical.
1316
+ - 'vertical': the events are arranged vertically.
1317
+ The indicator lines are horizontal.
1314
1318
1315
1319
lineoffsets : float or array-like, default: 1
1316
1320
The offset of the center of the lines from the origin, in the
1317
1321
direction orthogonal to *orientation*.
1318
1322
1319
- A sequence must match the dimension of *positions*
1320
- in the direction of *orientation *.
1323
+ If *positions* is 2D, this can be a sequence with length matching
1324
+ the length of *positions *.
1321
1325
1322
1326
linelengths : float or array-like, default: 1
1323
1327
The total height of the lines (i.e. the lines stretches from
1324
1328
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
1325
1329
1326
- If a sequence, then *positions* must be 2D and the length
1327
- must match the first dimension of *positions*.
1330
+ If *positions* is 2D, this can be a sequence with length matching
1331
+ the length of *positions*.
1328
1332
1329
- linewidths : float or array-like or None, default: None
1330
- The line width(s) of the event lines, in points. If it is None,
1331
- defaults to its rcParams setting.
1333
+ linewidths : float or array-like, default: :rc:`lines.linewidth`
1334
+ The line width(s) of the event lines, in points.
1332
1335
1333
- If a sequence, then *positions* must be 2D and the length
1334
- must match the first dimension of *positions*.
1336
+ If *positions* is 2D, this can be a sequence with length matching
1337
+ the length of *positions*.
1335
1338
1336
- colors : color or list of colors or None, default: None
1337
- The color(s) of the event lines. If it is None, defaults to its
1338
- rcParams setting.
1339
+ colors : color or list of colors, default: :rc:`lines.color`
1340
+ The color(s) of the event lines.
1339
1341
1340
- If a sequence, then *positions* must be 2D and the length
1341
- must match the first dimension of *positions*.
1342
+ If *positions* is 2D, this can be a sequence with length matching
1343
+ the length of *positions*.
1342
1344
1343
- linestyles : str or tuple or a sequence of such values, optional
1345
+ linestyles : str or tuple or list of such values, default: 'solid'
1344
1346
Default is 'solid'. Valid strings are ['solid', 'dashed',
1345
1347
'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples
1346
1348
should be of the form::
@@ -1350,11 +1352,10 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1350
1352
where *onoffseq* is an even length tuple of on and off ink
1351
1353
in points.
1352
1354
1353
- If a sequence, then *positions* must be 2D and the length
1354
- must match the first dimension of *positions*.
1355
-
1355
+ If *positions* is 2D, this can be a sequence with length matching
1356
+ the length of *positions*.
1356
1357
1357
- **kwargs : optional
1358
+ **kwargs
1358
1359
Other keyword arguments are line collection properties. See
1359
1360
`.LineCollection` for a list of the valid properties.
1360
1361
0 commit comments