RangeVarPlot("rangevar")
RangeVarPlot("expression involving $1")
Class for making a space plot. eg. voltage as function of path between two points on a cell. For plotting, an object of this type needs to be inserted in a Graph with g.addobject(rvp) By default, the location of the path nearest the root is location 0 (the origin) of the space plot.
If the rangevar does not exist at certain places in the path it is assumed to have a value of 0.
The first form where rangevar is "v" or "m_hh", etc. is very efficient since the object can store pointers to the variables for fast plotting.
The second form is much slower since the expression must be executed by the interpreter for each point along the path for each plot. Execution of the expression is equivalent to forsec seclist for (x) f(x) where the expression is the body of f. (Hence the use of $1 to denote the arc length position of the (temporary currently accessed section.)
See also
An example is plotting the transfer impedance ratio with
imp = h.Impedance()
rvp = h.RangeVarPlot("imp.amp($1)/imp0()") #how to do this in python?
rvp... #specify range begin and end
imp... #specify impedance computation
g = h.Graph()
g.addobject(rvp)
rvp.to_vector(yvec)
rvp.to_vector(yvec, xvec)
See also