Spike sum histogram of spike train data.
This class works with SpikeParams and SpikePlot to show the cumulative count of spikes from one cell from raster plots containing rows of spike trains.
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(sum_ratio=0.3, savefig=True)
sp.plot_spikes(spikes)
AUTHORS:
Draws a histogram on the right side of a raster plot that is the cumulative sum of spikes in the window.
Set the cell spike-count histogram from the SpikeParams object passed in.
Parameters: | spike_params – is a SpikeParams object. The spikes and line drawing parameters contained in it define what is drawn. |
---|
Set the style of the histogram bars. :param style: May be one of the following: - 'bar'
Makes a solid bar from zero to the bin height (default).