hnn_core.viz.plot_spikes_hist

hnn_core.viz.plot_spikes_hist(cell_response, trial_idx=None, ax=None, spike_types=None, color=None, show=True, **kwargs_hist)[source]

Plot the histogram of spiking activity across trials.

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.

spike_types: string | list | dictionary | None

String input of a valid spike type is plotted individually.

Ex: 'poisson', 'evdist', 'evprox', …

List of valid string inputs will plot each spike type individually.

Ex: ['poisson', 'evdist']

Dictionary of valid lists will plot list elements as a group.

Ex: {'Evoked': ['evdist', 'evprox'], 'Tonic': ['poisson']}

If None, all input spike types are plotted individually if any are present. Otherwise spikes from all cells are plotted. Valid strings also include leading characters of spike types

Ex: 'ev' is equivalent to ['evdist', 'evprox']
colorstr | list of str | dict | None

Input defining colors of plotted histograms. If str, all histograms plotted with same color. If list of str provided, histograms for each spike type will be plotted by cycling through colors in the list.

If dict, colors must be specified for all spike_types as a key. If a group of spike types is defined by the spike_types parameter (see dictionary example for spike_types), the name of this group must be used to specify the colors.

Ex: {'evdist': 'g', 'evprox': 'r'}, {'Tonic': 'b'}

If None, default color cycle used.

showbool

If True, show the figure.

**kwargs_histdict

Additional keyword arguments to pass to ax.hist.

Returns:
figinstance of matplotlib Figure

The matplotlib figure handle.