hnn_core.viz.plot_spikes_raster#

hnn_core.viz.plot_spikes_raster(cell_response, trial_idx=None, ax=None, show=True, cell_types=None, colors=None, show_legend=True, marker_size=1.0, dpl=None, overlay_dipoles=False, xticks=None, yticks=None, xlabel='Time (ms)', ylabel='Neuron index', title=None)[source]#

Plot the aggregate spiking activity according to cell type.

Parameters:
cell_responseinstance of CellResponse

The CellResponse object from net.cell_response

trial_idxint | list of int | None

Index of trials to be plotted. If None, all trials plotted

axinstance of matplotlib axis | None

An axis object from matplotlib. If None, a new figure is created.

showbool

If True, show the figure.

cell_typeslist of str

List of cell types to plot

colorslist of str | None

Optional custom colors to plot. Default will use the color cycler.

show_legendbool

If True, show the legend with colors for cell types

marker_sizefloat

Optional marker size to use when plotting spikes. Uses “linelengths” argument of ax.eventplot, which accepts positive numeric values only

dplinstance of Dipole | list

The Dipole object containing layer-specific dipole data to overlay on the raster plot

overlay_dipolesbool

If True, overlay the layer-specific dipole data on the raster plot

xtickslist | np.array | None

Ticks on x-axis. If None, ticks are created by matplotlib.

ytickslist | np.array | None

Ticks on y-axis, If None, ticks are created by matplotlib.

xlabelstr, default: “Time (ms)”

The matplotlib x-axis label

ylabelstr, default: “Neuron index”

The matplotlib y-axis label

titlestr | None

The matplotlib figure title

Returns:
figinstance of matplotlib Figure

The matplotlib figure object.