Plotting Plotting

In MOSES, a graph consists of one or more dependent variables plotted on one or two ordinate (vertical) axes, all against an independent variable which is plotted using the abscissa (horizontal) axis. Two ordinate axes (a left and an optional right axis) are available in order to graph variables which differ greatly in magnitude, but which the user wishes to present on the same graph. If two or more dependent variables are graphed, MOSES differentiates the curves by adding symbols to several points in each curve, and a legend is placed on the graph which defines these symbols. In addition, the title for the abscissa is set to the name of the independent variable, and for the left and right axes, each title is set to the name of the first dependent variable defined for that axis.

To produce a graph, one issues the command:

     PLOT, IVAR, L(1), L(2), .., -OPTIONS

and the available options are:

     -RAX, R(1), R(2), ..

     -LIMITS, X(1), X(2), ..


     -ADD, NUM_ADD

     -POINTS, LEGEND, X(1), Y(1), X(2), Y(2), ..





     -T_SUB, TITLE

     -T_X, TITLE




Here, IVAR is the column selector of the independent variable, and L(1), L(2), ..., L(n) are the column selectors of the dependent variables to be plotted using the left axis. If two ordinate axes are needed then the variables to be plotted on the right axis are added by using the option: -RAX. The -LIMITS option is used to limit the range of the X axis of a plot. Here, X1 and X2 define the allowable range of the independent variable.

Normally, each curve is drawn by merely connecting the data points with a series of straight lines. If, however, one uses -SMOOTH, the program will fit a set of cubic splines to the original data so that the root mean square of the fit is less than SM_TOL. Additionally, one can use the option -ADD so that NUM_ADD points are added between the original points, and the result plotted. Notice that a quite small value of SM_TOL (1E-7) with NUM_ADD = 0 will essentially reproduce the original plot, while the same value of SM_TOL with NUM_ADD greater than zero will produce a graph which passes through the original points with the additional ones added using the spline fit.

The -POINTS option adds the points specified as centered symbols to the plot. No lines will be drawn connecting these points. Here, LEGEND is the name given for the legend of the new points. The X values will be scaled the same as the independent variable, and the Y values will be scaled with the left axis. This option is useful for adding information to the plot from external sources, such as model test data.

The option -CLEAN_LINE instructs MOSES to use color only to distinguish between curves on the plot. Normally, the legend box is drawn in the domain of the plot, and it is possible that some of the curves will be drawn in the legend box. The -CROP_FOR_LEGEND option tells MOSES to change the behavior so that a curve will never enter into the legend box.

The behavior of MOSES after the PLOT command is issued depends on the options -NO_EDIT, -T_MAIN, -T_SUB, -T_X, -T_LEFT, -T_RIGHT, and -LEGEND. If none of these options were specified, MOSES will go into edit mode and will ask the user which legend (or title) he wishes changed. An empty line (a simple carriage return) will take MOSES out of edit mode. Note that each legend is limited to twenty characters, while each title may be up to seventy-two characters in length. With these options, TITLE is a string (probably delimited by ' to include blanks), and the option keyword defines where the title will be placed. For -LEGEND, NUMBER is the legend number where title will be placed.

After a graph has been made, the user may elect to make another graph with the same variables, but change some of the options. The AGAIN command is provided for this purpose.


Here, any of the options valid for the PLOT command may be specified.

After a graph has been made, a copy may be written to a file for later processing by using the SAVE_GRAPH command,


The file used by this command is specified on the -G_DEFAULT option of the &DEVICE command.

MOSES will, in general, compute a scale for each axis of a graph so that the functions will "fill" up the page. In some circumstances, one may wish to establish the same scale for several different plots. This can be accomplished via the RANGE command, the form of which is:


and the available options are:




If one of the options is issued and no data follows, then the axis specified by the keyword will be automatically scaled. To control the scaling of an axis, one should follow the axis keyword with two numbers: the minimum value for the axis and the maximum number for the axis. These extremes will then be used to establish the scale. Notice that when the automatic scaling is not in operation, it is possible that some portion of the curves may be off of the page.