simplot

Simplot interpreter program

simplot [inputfile]

Description

simplot is a standalone program, which reads an input file, with .sim extension, (or standard input) and interprets the simplot-commands it contains. A very simple example of an input file is the following:
plinit PS simplot1 A4 50 50 "" ""
xl=100 yl=xl/2 plset HEIGHT xl/50
plaxes 0 0 100 100 xl yl X Y "Simplot interpreter example"
n=5 plrdxy n 3 10 22 50 40 20 60 80 80 30
plpline n X DOWN plframe 5 3
This example generates the following picture:

simplot1

This example illustrates most properties of the simplot interpreter:
  • simplot subroutines are called by their standard name, followed by all parameters needed, separated with white-space.
  • strings may be entered without double quotes unless white-space is to be included.
  • array parameters are omitted; the program knows about three arrays x, y and z, which may be filled using special subroutines plrdx, plrdy, plrdz and plrdxy. These routines have one parameter, which tells how many values or (for plrdxy) pairs of values will follow.
  • Numerical variables may be created with an assignment statement of the form var=x; any undefined variables used will be created with a value of 0.
  • predefined variables (both numerical and string) like HEIGHT, PS, A4P and are recognized by the interpreter; they may be used in expressions.
  • instead of numbers, simple expressions may be used; legal operators are +, -, *, and /. Parentheses may be used to any depth.
  • in this program, plformat has two limitations:

Limitations

Some facilities can not be used in the interpreter:
  • the 's' and '[]' formats may not be used; strings to be plotted must be incorporated in the format-string.
  • the maximum number of parameters is 11, including the format-string.
  • subroutines like plfunc which need a function parameter can not be used.
  • functions like plget and plpolc can be used; they report their result to standard error, but the result can not be used or assigned to a variable.

Examples

This manual contains many examples of applications of the simplot interpreter. By using a good editor, quite complex inputfiles can be created, especially if many repetitive items have to be plotted. An example of such a plot (without the corresponding 180-line inputfile) is shown below:

simplot2