isi_distribution

Contents

isi_distribution#

class braintools.visualize.isi_distribution(spike_times, bins=50, max_isi=None, log_scale=False, ax=None, figsize=(10, 6), color='blue', alpha=0.7, xlabel='Inter-Spike Interval', ylabel='Count', title=None, **kwargs)#

Plot inter-spike interval (ISI) distribution.

Parameters:
  • spike_times (ndarray | List) – Spike times, list of spike time arrays, or a braintools.spike.SpikeTrains (intervals are computed within each neuron, in its unit).

  • bins (int | ndarray) – Number of bins or bin edges.

  • max_isi (float | None) – Maximum ISI to include. With a SpikeTrains, a Quantity is converted to the unit of its times.

  • log_scale (bool) – Whether to use log scale for y-axis.

  • ax (Axes | None) – Axes to plot on.

  • figsize (Tuple[float, float]) – Figure size if creating new figure.

  • color (str) – Bar color.

  • alpha (float) – Alpha transparency.

  • xlabel (str) – Axis labels and title.

  • ylabel (str) – Axis labels and title.

  • title (str | None) – Axis labels and title.

  • **kwargs – Additional arguments passed to hist.

Returns:

ax – The axes object containing the plot.

Return type:

Axes

See also

braintools.analysis.spike.isi

The intervals that are plotted.

braintools.analysis.spike.cv

The coefficient of variation shown in the box.

Notes

The intervals are computed within each neuron and pooled over neurons; for a SpikeTrains with braintools.analysis.spike.isi(), for the other inputs directly from the flat spike times (memory proportional to the number of spikes). The box shows their mean and their coefficient of variation (population standard deviation over mean, computed with braintools.analysis.spike.cv() on the pooled intervals); the CV is shown as 0 for fewer than two intervals. Both are computed after the max_isi cut, so a cut that removes the long tail lowers them.