Spike time histogram of spike train data.
This class works with SpikeParams and SpikePlot to place a histogram of spikes under a raster plot (or by itself if the spike raster plot is not shown).
For detailed examples, see
EXAMPLES:
This example generates some random “spikes” and displays them.
import numpy
from neuronpy.graphics import spikeplot
spikes = []
num_cells = 10
num_spikes_per_cell = 20
frequency = 20
# Make the spike data. Use a simple Poisson-like spike generator
# (just for illustrative purposes here. Better spike generators should
# be used in simulations).
for i in range(num_cells):
isi=numpy.random.poisson(frequency, num_spikes_per_cell)
spikes.append(numpy.cumsum(isi))
# spikes is now a list of lists where each cell has a list of spike
# times. Now, let's plot these spikes with the default parameters.
sp = spikeplot.SpikePlot(sth_ratio=0.3, savefig=True)
sp.plot_spikes(spikes)
AUTHORS:
Convolve the 1d input with the kernel.
Parameters: |
|
---|
..note:
The time of the histogram bin that is filtered is the left edge and not
the center of the bin.