Plots an equation on a graph (R.W. Payne).
Options
WINDOW = scalars |
Window in which to plot the equation; default 1 |
RESIZE = string tokens |
Whether to resize the window (yes, no); default ‘no’ |
Parameters
Y = scalars |
Y-coordinates for each equation |
X = scalars |
X-coordinates for each equation |
EQUATION = expressions or formulae |
Equations to plot |
PEN = scalars |
Pen to use for each equation |
Description
The
DEQUATION
procedure adds an equation to a plot. The equation is specified by the EQUATION
parameter, and can be either an expression or a formula. The Y
and X
parameters specify where to plot the equation. The PEN
parameter specifies the pen (default 1), and the WINDOW
option specifies the window containing the plot (default 1). You can set the RESIZE
to yes to resize the window, so that the equation can be plotted outside the current area when a graph has no spare space.Options: WINDOW
, RESIZE
Parameters: Y
, X
, EQUATION
, PEN
See also
Directives: EXPRESSION FORMULA
Procedures: DARROW
DERRORBAR
DFRTEXT
GenStat Reference Manual 1 Summary section on: Graphics
Example
CAPTION ''DEQUATION examples',\ '1) Split plot design (Guide to Genstat 2:4.2.1)';\ STYLE=meta,plain spload '%data%/Oats.gsh' " Convert yields to cwt per acre." CALCULATE yield=(yield*80)/(112*4) " Define the treatment structure: factorial effects of V and N." FORMULA [VALUE=variety*nitrogen] treatments TREATMENTS #treatments " Subplots nested within whole-plots nested within blocks." BLOCK blocks/wplots/subplots ANOVA [PRINT=means] yield AGRAPH DEQUATION Y=13.5; X=2.5; EQUATION=treatments CAPTION '2) Parabola y = x**2 - 5*x + 8' EXPRESSION [VALUE=y = x**2 - 5*x + 8] parabola VARIATE [VALUES=0,0.1...5] x CALCULATE #parabola PEN 1; SIZE=1.5 PEN 2; COLOUR='blue'; METHOD=line; SYMBOL=0; THICKNESS=1.5 DGRAPH [WINDOW=3; KEY=0] Y=y; X=x; PEN=2 DEQUATION [WINDOW=3; RESIZE=yes] Y=0.75; X=1; EQUATION=parabola