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 abraintools.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 aSpikeTrains, 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.**kwargs – Additional arguments passed to hist.
- Returns:
ax – The axes object containing the plot.
- Return type:
Axes
See also
braintools.analysis.spike.isiThe intervals that are plotted.
braintools.analysis.spike.cvThe coefficient of variation shown in the box.
Notes
The intervals are computed within each neuron and pooled over neurons; for a
SpikeTrainswithbraintools.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 withbraintools.analysis.spike.cv()on the pooled intervals); the CV is shown as 0 for fewer than two intervals. Both are computed after themax_isicut, so a cut that removes the long tail lowers them.