A Y Function() function is used to draw smooth functions. The first argument is the expression to be plotted. The second argument is the name of the X variable in the expression.
X Name( "x" ),
Y Name( "Sine(x)" ),
图 12.32 Sine Wave
You can use For to overlap several sine waves:
图 12.33 Overlapping Sine Waves
Similarly, X Function() is for drawing a graph where the symbol is varied on the Y variable.
An XY Function() draws a smooth curve using a pair of formulas (parametric equations) that depend on a third variable. The third variable’s value is incremented from a minimum value to a maximum value to generate the X-Y pairs.
minAngle = 0;
In this example, Sin() and Cos() use ta as an argument (rotates) and as a factor (expands). (Sin() and Cos() use radians, not degrees.)
图 12.35 Spiral Parametric Plot
Contour Function() is an analogous way to represent a three-dimensional function in a two-dimensional space. The final argument specifies the value(s) for the contour line(s). The argument can be a value, an indexed range of values using ::, or a matrix of values.
图 12.36 Egg Carton Function
Normal Contour() draws normal probability contours for k populations and two variables. The first argument is a scalar probability or a matrix of probability values for the contours. Subsequent arguments are matrices to specify means, standard deviations, and correlations. The mean and standard deviation matrices have dimension k × 2. The correlation matrix should be k × 1, where the first row pertains to the first contour, the second row to the second contour, and so on. The first column is for x and the second column for y. Consider the following example:
The following script draws contours at probabilities 0.1, 0.5, 0.7, and 0.99 for two populations and two variables. The first population has x mean 0 and y mean 1, with standard deviation 0.3 along the x axis and 0.6 along the y-axis, and with correlation 0.5. The second has x mean 4 and y mean 6, with standard deviation 0.8 along the x axis and 0.4 along the y-axis, and with correlation 0.9.
图 12.37 Normal Contour Function
Normal Contour() is a general way to accomplish effects such as Bivariate’s density ellipses. The Bivariate script in the Football.jmp sample data creates an example.
Gradient Function() fills a set of rectangles on a grid according to a color determined by the expression value as it crosses a range corresponding to a range of colors.
Gradient Function( expression, xname, yname, [zlow, zhigh], ZColor( [colorLow, colorHigh] ), <XGrid( min, max, incr )>, <YGrid( min, max, incr )>, <Transparency( t )>;
Here are explanations of the elements in the Gradient Function() syntax:
GradientFunction(
The ZColor() values must be numeric codes rather than names. You can use the color menu indices (such as 0=black, 1=grey, 2=white, 3=red, 4=green, and 5=blue) found in Specify Colors.
The following example uses Gradient Function() to create an animated graph.
phase = 0.7;
a = Graph(
[-1 1],
b = a[FrameBox( 1 )];
b << Reshow;
b << Reshow;
图 12.38 Gradient Function