spiketools.plts.trials.plot_rasters

spiketools.plts.trials.plot_rasters(spikes, events=None, vline=None, colors=None, vshade=None, show_axis=False, ax=None, **plt_kwargs)[source]

Plot rasters across multiple trials.

Parameters:
spikeslist of list of float or dict

Spike times per trial. Multiple conditions can also be passed in. If dict, each key is a condition label and each value the list of list of spikes times.

eventslist

Events to indicate on the raster plot. Should have length of number of trials.

vlinefloat or list of float, optional

Location(s) to draw a vertical line. If None, no line is drawn.

colorsstr or list of str or dict, optional

Color(s) to plot the raster ticks. If more than one, should match the number of conditions. If a dictionary, the labels should match the spike condition labels.

vshadelist of float or list of list of float, optional

Vertical region(s) of the plot to shade in.

show_axisbool, optional, default: False

Whether to show the axis around the plot.

axAxes, optional

Axis object upon which to plot.

plt_kwargs

Additional arguments to pass into the plot function. Custom kwargs:

line: ‘line_color’, ‘line_lw’, ‘line_alpha’ shade: ‘shade_color’, ‘shade_alpha’ events: ‘event_color’, ‘event_linewidths’, ‘event_linelengths’