Page 1 of 1

Space Plot

Posted: Thu Mar 14, 2013 10:26 am
by namrata27
I would like to plot a space plot using a session file or hoc file with the keep lines command available during the GUI interface of ploting a space plot .

Re: Space Plot

Posted: Thu Mar 14, 2013 11:01 am
by ted
namrata27 wrote:I would like to plot a space plot using a session file or hoc file with the keep lines command available during the GUI interface of ploting a space plot .
I don't understand your request. A space plot is like any other graph. To turn on Keep Lines, just click on its menu box (upper left corner of the canvas) and select the Keep Lines item. Are you asking how to use a hoc statement to turn on Keep Lines?

Re: Space Plot

Posted: Thu Mar 14, 2013 11:10 am
by namrata27
Yes I want to write a hoc code for the keep lines so that I dont have to do it manually (using GUI interface)

Re: Space Plot

Posted: Thu Mar 14, 2013 11:33 am
by ted
Every graph class has a method called exec_menu. Read about it here
http://www.neuron.yale.edu/neuron/stati ... #exec_menu
The key is to know the name of the graph, or of the objref that points to the graph.
If you created a graph via hoc code like
objref foo
foo = Graph()
or
foo = Shape()
or
foo = PlotShape()
then
foo.exec_menu("Keep Lines")
is equivalent to clicking on the Keep Lines item in the graph menu.

If instead you created a graph by using the NEURON Main Menu toolbar, there isn't an objref that points to the graph. So
click on the graph's menu box (in the upper left corner of its canvas)
carefully move the cursor up to "View . . . " so that the graph's secondary menu appears
then carefully move the cursor over to the secondary menu and drag it down to the "Object Name" item

hoc will then print the name of the graph. It will look something like
Graph[1]
or
PlotShape[0]
So the hoc command would be
Graph[1].exec_menu("Keep Lines")
or
PlotShape[0].exec_menu("Keep Lines")