Space Plot

Anything that doesn't fit elsewhere.
Post Reply
namrata27

Space Plot

Post by namrata27 » Thu Mar 14, 2013 10:26 am

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 .

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

Re: Space Plot

Post by ted » Thu Mar 14, 2013 11:01 am

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?

namrata27

Re: Space Plot

Post by namrata27 » Thu Mar 14, 2013 11:10 am

Yes I want to write a hoc code for the keep lines so that I dont have to do it manually (using GUI interface)

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

Re: Space Plot

Post by ted » Thu Mar 14, 2013 11:33 am

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")

Post Reply