MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / eventplot

Method eventplot

lib/matplotlib/axes/_axes.py:1302–1541  ·  view source on GitHub ↗

Plot identical parallel lines at the given positions. This type of plot is commonly used in neuroscience for representing neural events, where it is usually called a spike raster, dot raster, or raster plot. However, it is useful in any situation where you

(self, positions, orientation='horizontal', lineoffsets=1,
                  linelengths=1, linewidths=None, colors=None, alpha=None,
                  linestyles='solid', **kwargs)

Source from the content-addressed store, hash-verified

1300 "colors", "linestyles"])
1301 @_docstring.interpd
1302 def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
1303 linelengths=1, linewidths=None, colors=None, alpha=None,
1304 linestyles='solid', **kwargs):
1305 """
1306 Plot identical parallel lines at the given positions.
1307
1308 This type of plot is commonly used in neuroscience for representing
1309 neural events, where it is usually called a spike raster, dot raster,
1310 or raster plot.
1311
1312 However, it is useful in any situation where you wish to show the
1313 timing or position of multiple sets of discrete events, such as the
1314 arrival times of people to a business on each day of the month or the
1315 date of hurricanes each year of the last century.
1316
1317 Parameters
1318 ----------
1319 positions : array-like or list of array-like
1320 A 1D array-like defines the positions of one sequence of events.
1321
1322 Multiple groups of events may be passed as a list of array-likes.
1323 Each group can be styled independently by passing lists of values
1324 to *lineoffsets*, *linelengths*, *linewidths*, *colors* and
1325 *linestyles*.
1326
1327 Note that *positions* can be a 2D array, but in practice different
1328 event groups usually have different counts so that one will use a
1329 list of different-length arrays rather than a 2D array.
1330
1331 orientation : {'horizontal', 'vertical'}, default: 'horizontal'
1332 The direction of the event sequence:
1333
1334 - 'horizontal': the events are arranged horizontally.
1335 The indicator lines are vertical.
1336 - 'vertical': the events are arranged vertically.
1337 The indicator lines are horizontal.
1338
1339 lineoffsets : float or array-like, default: 1
1340 The offset of the center of the lines from the origin, in the
1341 direction orthogonal to *orientation*.
1342
1343 If *positions* is 2D, this can be a sequence with length matching
1344 the length of *positions*.
1345
1346 linelengths : float or array-like, default: 1
1347 The total height of the lines (i.e. the lines stretches from
1348 ``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
1349
1350 If *positions* is 2D, this can be a sequence with length matching
1351 the length of *positions*.
1352
1353 linewidths : float or array-like, default: :rc:`lines.linewidth`
1354 The line width(s) of the event lines, in points.
1355
1356 If *positions* is 2D, this can be a sequence with length matching
1357 the length of *positions*.
1358
1359 colors : :mpltype:`color` or list of color, default: :rc:`lines.color`

Callers 14

eventplotFunction · 0.80
test_eventplotMethod · 0.80
test_eventplotFunction · 0.80
test_eventplot_defaultsFunction · 0.80
test_eventplot_colorsFunction · 0.80
test_eventplot_alphaFunction · 0.80
test_empty_eventplotFunction · 0.80
test_eventplot_legendFunction · 0.80
test_eventplot_errorsFunction · 0.80

Calls 7

_process_unit_infoMethod · 0.80
add_collectionMethod · 0.80
_internal_updateMethod · 0.80
minMethod · 0.80
maxMethod · 0.80
update_datalimMethod · 0.45

Tested by 11

test_eventplotMethod · 0.64
test_eventplotFunction · 0.64
test_eventplot_defaultsFunction · 0.64
test_eventplot_colorsFunction · 0.64
test_eventplot_alphaFunction · 0.64
test_empty_eventplotFunction · 0.64
test_eventplot_legendFunction · 0.64
test_eventplot_errorsFunction · 0.64