Simple example
|
2: Simple Gri Program and How to Run itThis chapter introduces Gri with a common example: a x-y graph. The example is discussed in detail later see X-y Plots. The data files and command files here and throughout the manual should be available to you in a directory `.../gri/examples' on unix machines.
2.1: Gri Command fileHere is a Gri command file to plot a linegraph of a set of (x,y) data, stored as space-separated columns in a file called `example1.dat':
The first line is a comment, as are all things following double slashes.
(An exception to this double-slash rule is made within strings contained
within the double-quote character ` The other lines are Gri command lines; see X-y Plots. for more explanation.
2.2: Data FileThe data file `example1.dat' looks like:
Note that spaces (or tabs) separate numbers. Any data line may have a comment on it, just as any command line may.
2.3: Running The Command FileType `gri example1.gri' at the system prompt. Gri will create a PostScript file called `example1.ps'. For details on running Gri see Invoking Gri..
2.4: Output GraphThe output PostScript file is called `example1.ps'.
It looks something like the miniature shown above.
To view Gri output, use your favorite PostScript previewer; see Viewing. Note that in the above example, Gri automatically chose reasonable scales for the axes, based on the range of the data. The next chapter illustrates that Gri also gives you control over such things.
|