Page 1 of 1

Arguments to addvar?

Posted: Wed Aug 20, 2008 11:29 pm
by Eric Thomson
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]?

Re: Arguments to addvar?

Posted: Thu Aug 21, 2008 10:05 am
by ted
Will using [2] instead of [1] get me in any trouble?
What you're calling "[2]" is just the second form presented in the Programmer's Reference.
what is the meaning of all the arguments to addvar in [1]?
The quickest way to find out is to play with them and see what happens. So, what did you figure out?

Re: Arguments to addvar?

Posted: Thu Aug 21, 2008 11:57 am
by Eric Thomson
ted wrote:What you're calling "[2]" is just the second form presented in the Programmer's Reference.
Yes, I used the simplest call in which line color can be specified.

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.

Re: Arguments to addvar?

Posted: Thu Aug 21, 2008 3:25 pm
by ted
Eric Thomson wrote:it would be helpful if Chapter 6 briefly mentioned how to control the line width and color within hoc.
Those who are interested will find this documented in the Programmer's Reference.