I have created a network of biophysical cells (around 50) with a simple ring architecture. Each cell has a single connection to each beside it. I stimulate firing in the soma of one cell, and watch the spikes propogate through the ring using the simple v graph, plotting about 8 different cells through the ring.
I would like to generate a raster plot of the spikes with t along x axis, cell no. along y axis, and dots representing spikes. I am under the impression that this is an option native to the gui, but I am unable to find it.
Forgive me if this is somewhere else in the forums, but I have spent much of the day googling and searching these pages.
Thanks,
Andrew
Raster plot of spikes in network
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Generating your own raster plot with hoc
Then you'll have to roll your own with hoc. Piece of cake with the NetCon class's record() method--abogaard wrote:(without SpikePlot, since I did not use network builder)
http://www.neuron.yale.edu/neuron/stati ... tml#record
In particular, I refer to the netcon.record(tvec, idvec, id) syntax.
For example, suppose your model neurons have been appended to a List called cells, and
that each one has its spike trigger zone at its soma. Then
Code: Select all
objref timevec, idvec, recncs, tobj, nil
timevec = new Vector()
idvec = new Vector()
recncs = new List()
for i=0,cells.count()-1 {
cells.object(i).soma tobj = new NetCon(&v(0.5), nil)
tobj.record(timevec, idvec, i+1) // so all the spike rasters lie above the x axis
recncs.append(tobj)
}
objref tobj // so we don't accidentally mess up the last NetCon
new Graph object, and use the Vector class's mark() method to draw vertical bars | --see
http://www.neuron.yale.edu/neuron/stati ... .html#mark
Code: Select all
objref g
proc plotraster() {
g = new Graph()
idvec.mark(g, timevec, "|")
}
proc myrun() {
run()
plotraster()
}
// call myrun() to launch a simulation and generate a raster plot
or implementing a dynamically-updated raster plot, but this should be enough to get you
going.
Re: Raster plot of spikes in network
Hi,
I following the code for raster plot in this thread . When I run it the spikes are misplaced.
Ex.

I wonder how could I fix the scale of the graph? Is it possible to make it auto adjust?
Thanks in advance.
I following the code for raster plot in this thread . When I run it the spikes are misplaced.
Ex.

I wonder how could I fix the scale of the graph? Is it possible to make it auto adjust?
Thanks in advance.
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Raster plot of spikes in network
No, they're exactly where they should be. You need to specify axis scales that span your data. Read about the Graph class's methods for specifying axis ranges--it's in the Programmer's Reference.ps0322 wrote:the spikes are misplaced.
Click on the graph's menu box (left upper corner of its canvas), choose "Set view" from the graph's secondary menu, then specify the x and y axis ranges. Or use the Graph class's functions for doing this--see the Programmer's Reference.how could I fix the scale of the graph?
Select "View = plot" from the graph's secondary menu. Or use the graph's exec_menu() method to execute "View = plot"--see the Programmer's Reference.Is it possible to make it auto adjust?
You might find it helpful to read "How to use hoc to plot a variable vs. time"--it's in the Hot tips area of the Forum.