In the code I'm using from the book, the addvar process is typically fed six arguments (e.g., listing 6.3):
g.addvar("soma.v(0.5)",1,1,0.6,0.9,2) [1].
However, from the hoc reference online (http://www.neuron.yale.edu/neuron/stati ... tml#addvar), the different ways to call addvar include:
g.addvar("variable")
g.addvar("variable", color_index, brush_index)
g.addvar("label", "variable")
g.addvar("label", "variable", color_index, brush_index)
Because I understand it better, I've been cutting out a bunch of the arguments in [1], using something like:
g.addvar("soma.v(0.5)",1,1) [2].
Will using [2] instead of [1] get me in any trouble?
Also, and what is the meaning of all the arguments to addvar in [1]?
Arguments to addvar?
-
- Posts: 15
- Joined: Thu Mar 02, 2006 11:18 am
- Contact:
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Arguments to addvar?
What you're calling "[2]" is just the second form presented in the Programmer's Reference.Will using [2] instead of [1] get me in any trouble?
The quickest way to find out is to play with them and see what happens. So, what did you figure out?what is the meaning of all the arguments to addvar in [1]?
-
- Posts: 15
- Joined: Thu Mar 02, 2006 11:18 am
- Contact:
Re: Arguments to addvar?
Yes, I used the simplest call in which line color can be specified.ted wrote:What you're calling "[2]" is just the second form presented in the Programmer's Reference.
For those interested, the undocumented arguments four through six seem to affect the appearance of the label, not the lines (they influence the label's horizontal position, vertical position, and amount of label shown, respectively). It isn't clear how they all work, so documentation would be nice. For now I'll use the simpler call until my labels start to look funny.
On a related topic, it would be helpful if Chapter 6 briefly mentioned how to control the line width and color within hoc.
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Arguments to addvar?
Those who are interested will find this documented in the Programmer's Reference.Eric Thomson wrote:it would be helpful if Chapter 6 briefly mentioned how to control the line width and color within hoc.