## shifted plots

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc.
reimar

### shifted plots

hello!

is it possible to generate a plot with the voltage of the several parts of a segment in one graph window?- yes, just select it via "plot what?"
but is it also possible to shift these voltage plots so that the top line sybolizes the first part, ..., the bottom line the last part of the segment so that one has a little spatial effect of the voltage across the nerve?

and is it possible to have a plot with shifted lines like above but not plottes versus time but versus space (similar to the space plot; without the movie run but with shifted lines where each line represents the voltage across the whole fiber at a certain time)?

best regards,
reimar

ted
Posts: 5742
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: shifted plots

reimar wrote:is it possible to generate a plot with the voltage of the several parts of a segment in one graph window?- yes, just select it via "plot what?"
You mean "section", not "segment". A segment is a single compartment, and the variables associated with it represent values at a single point in space. A section may have many segments.
but is it also possible to shift these voltage plots so that the top line sybolizes the first part, ..., the bottom line the last part of the segment so that one has a little spatial effect of the voltage across the nerve?
"All things are possible with programming." Use the Vector class's record() method to capture the time course of voltage in each segment. Then, after the end of the simulation, use the Vector class's add() method to add a "vertical offset" to the values in each Vector. Finally, use the Vector class's plot() method to plot the contents of each Vector onto a Graph. The Vector class and its methods are described in the Programmer's Reference here:
http://www.neuron.yale.edu/neuron/stati ... .html#plot
and is it possible to have a plot with shifted lines like above but not plottes versus time but versus space (similar to the space plot; without the movie run but with shifted lines where each line represents the voltage across the whole fiber at a certain time)?
You can do this by sampling each of your recorded Vectors at appropriate intervals and plotting the values in a Graph. The easiest way to do the sampling would be to (1) use the recorded Vectors to build a Matrix, one row at a time, via the Matrix class's setrow() method, then (2) use the Matrix class's getcol() method to extract the values from every nth column into a new set of "v in space" vectors where n*dt is the desired time interval between your space plots. Then add the appropriate offset to each "v in space" vector, and plot them in a Graph.

Not much programming required.