Turn Keep Lines on in hoc and preserve color info

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc.
Post Reply
Posts: 14
Joined: Fri Jun 17, 2005 10:01 am
Location: Philadelphia, PA, USA

Turn Keep Lines on in hoc and preserve color info

Post by jtmoyer »

How can I turn on Keep Lines from the hoc code without using the Graph.family() command? Specifically I have a bunch of different variables being plotted in different colors, and calling family() changes all the colors to black.
Site Admin
Posts: 5935
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Post by ted »

Good question.
Use the Graph class's exec_menu() method. From the Programmer's
Reference this short quotation:
g.exec_menu("item name")
Equivalent to pressing and releasing one of the items in the Graph menu with the right mouse button.
Read about it here:
http://www.neuron.yale.edu/neuron/stati ... #exec_menu

Of course this begs another question:
"Suppose I created the graph by using the GUI? How do I know what name
to call the graph?"
Click on the graph's menu box, then move the cursor slightly up and over
to the right to reveal the graph's secondary menu, and then drag the
cursor down to the last item in the secondary menu, which is called
"Object Name". hoc will print the name of the graph object in NEURON's
Post Reply