spiketools.plts.trials.plot_raster_and_rates¶
- spiketools.plts.trials.plot_raster_and_rates(spikes, bins, time_range, conditions=None, colors=None, title=None, raster_kwargs=None, rate_kwargs=None, figsize=(6, 4), axes=None, **plt_kwargs)[source]¶
Plot event-related raster plot with corresponding binned firing rate plot.
- 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.
- binsfloat or 1d array
The binning to apply to the spiking data. If float, the length of each bin. If array, precomputed bin definitions.
- time_rangelist of [float, float], optional
Time range, in seconds, to create the binned firing rate across. Only used if bins is a float.
- conditionslist, optional
Condition labels for each trial. If provided, used to split the data by condition before plotting.
- colorsstr or list of str or dict, optional
Color(s) to plot the firing rates. If more than one, should match the number of conditions. If a dictionary, the labels should match the spike condition labels.
- raster_kwargsdict, optional
Additional keyword arguments for the raster plot, passed into plot_rasters.
- rate_kwargsdict, optional
Additional keyword arguments for the firing rate plot, passed into plot_rate_by_time.
- figsizetuple, optional, default: (6, 4)
Size of the figure to create. Only used if axes is None.
- axeslist of [Axes, Axes]
Axes objects upon which to plot.
- plt_kwargs
Additional arguments to pass into the plot function. Custom kwargs: ‘line_color’, ‘line_lw’, ‘line_alpha’, ‘line_linestyle’.