Grapher

StandardRunWidgets
   EraseAll       IndepBegin     IndependentVar  Steps         
   Generator      IndepEnd       Plot           Xexpr          
A widget for graphing any set of expressions as a function of an independent variable.

The Grapher is similar to a "for" statement. It iterates the independent variable over the range spanned by the x-axis in "Steps" increments. At each step, it executes the statements specified in the Generator field (if any), and plots the values that are specified in the Graph scene from the PlotWhat menu item. These values can be variable names or function names.

To pop up the widget say:

execute following example

	load_template("Grapher")	// reads this file
	makegrapher()			// simple way to pop up a new grapher
Creating a grapher using
	makegrapher(1)
will add an item for setting the x-axis expression and buttons for specifying the limits of the independent variable

Graphers may be saved in a .session file.

To use the grapher widget:

	1) enter the independent variable name (press the button) eg. x
	2) specify the y variables:
		in the graph panel press the left button and select "Plot What?"
		and enter an expression or variable to plot. eg. sin(x)
		You can do this several times to plot several expressions.
	3) either
		 press the Plot button.
			the independent variable will range from the beginning
			to the end of the x-axis
	   or
	----
	3) Specify the view from the graph panel popup menu by selecting the
		"Set View" item. You may also want to fix this as the
		Scene size by subsequently selecting the "Scene=View" item
	4) If the y variables are actual functions of the independent variable
		press the Plot button to see the plot. If the y variables
		are in fact just variables then you will need a generator
		statement that tells how to compute the y variables given
		a value of the independent variable. eg. Just for fun you can
		try entering the generator statement:
			print x, sin(x)

EXAMPLES

	Example 1: plot sin(t)
	1) PlotWhat: sin(t)
	2) Plot

Example 2: plot of steady state m process in nrniv 1) Independent Var: x 2) Generator: rates_hh(x) 3) Set View: x: -100 50 y: 0 1 4) PlotWhat: minf_hh 5) Plot Example 3: In context of Neuron Main Menu simulation 0) pop up grapher by selecting appropriate "New Graph" submenu item. 1) Independent Var: v_init 2) Generator: init() 3) PlotWhat: 4) SetView: x: -100 50 y:cancel 5) Plot

Example 4: peak inward current during voltage clamp Replace the standard: proc advance() {fadvance()} with a procedure that stores the peak inward current (and possibly sets stoprun=1 when you are past the peak). Then in the Grapher set Steps to 20 the independent variable to the voltage clamp amplitude and the generator to run().


Plot

Grapher
For each value of the independent variable the generator statement is executed (if it exists) and the PlotWhat expressions are plotted.


EraseAll

Grapher
Removes all expressions from the graph.


Steps

Grapher
Number of independent variable values used to make the graph. For the small grapher, the range of the independent variable is the length of the x-axis.


IndependentVar

Grapher
Dialog appears requesting the variable to be used as the independent variable (default t). If the variable is undefined it will be created.


Generator

Grapher
A statement to be executed after setting a value of the independent variable but before plotting the expressions. This allows plotting of variables that depend implicitly on the independent variable.


IndepBegin

Grapher
For a grapher made with makegrapher(1), specifies initial value of the independent variable.


IndepEnd

Grapher
Specifies final value of independent variable.


Xexpr

Grapher
A grapher made with makegrapher(1) allows separate specification of independent variable and the x axis plot functions. This allows phase plane plots. The Xexpr may be any function of the independent variable or an implicit function if a generator statement exists.


neuron/stdrun/grapher.hel : Jul 8 07:21