Page 1 of 1

Plotting current (i) delivered by IClamp

Posted: Mon Aug 25, 2008 12:32 am
by kathryn
I've compiled the iclamp1.mod code from page 219 of The Neuron Book (Example 9.3), in order to add an intracellular stimulating electrode to a model. The custom GUI I built includes a graph for plotting voltage against time, but I was wondering how to generate an equivalent graph for the current delivered (i) by IClamp1. (It's a question provoked by curiosity rather than need, since the graph would only show a rectangular current pulse.)

Re: Plotting current (i) delivered by IClamp

Posted: Mon Aug 25, 2008 7:22 am
by csh
From hoc, you could do:

Code: Select all

objref ic, g
g = new Graph()
ic = new IClamp1(0.5)
g.addvar("ic.i")
addplot(g, 0)
Alternatively, you can use the GUI: Choose "Graph->Current axis" from the menu, right-click on the graph, select "Plot what", left-click "Show->All" in the dialog, select your IClamp1 object in the left panel ("ic" in the example above), select "i" in the middle panel.
The plotting system is explained in chapter 7, pp. 179-181 of the Neuron book.

Re: Plotting current (i) delivered by IClamp

Posted: Wed Aug 27, 2008 12:34 am
by kathryn
csh wrote:Choose "Graph->Current axis" from the menu, right-click on the graph, select "Plot what", left-click "Show->All" in the dialog, select your IClamp1 object in the left panel ("ic" in the example above), select "i" in the middle panel.
Thanks! I used the GUI method. Other readers might like to know I had to double-click the IClamp1 object in the left panel, which brought up "0." in the middle panel (my model's only IClamp1 object). Double-clicking "0." brought up a list of the available variables (including amp, dur, del, and i). From there I selected "i".

Thanks also for directing me to the relevant section of The Neuron Book.