WHAT ARE PREFABS?Prefabs are the easiest way to get started with ploticus. You can quickly generate common types of plots without coding any ploticus scripts. Just supply several key parameters on the command line or in the data file. Everything else uses defaults.
The -prefab command line option tells pl to use a prefab. Any of the other command options may also be used along with -prefab. For example, to use the scat scatterplot prefab you might use a command such as this:
Prefab scripts are ordinary ploticus scripts. A collection of prefab scripts
are included with ploticus in the ./prefabs directory.
You can use this directory or set up one of your own.
An environment variable called PLOTICUS_PREFABS must exist and
contain the full path name of the directory where prefab scripts reside.
Some parameters are standard (recognized by most of the prefabs); others are specific to the individual prefabs.
Parameters may be supplied on the pl command line as var=value pairs as seen in the above example.
Most parameters may also be embedded in an input data file, using the #set construct:
Some parameters cannot be set from within the data file because they control
data scanning. These are data, delim, header, and comment.
There may be others as noted for individual prefabs.
OUTPUT FILE NAMES
The -o option may be used to specify output file name explicitly.
If -o is not given,
output file naming is similar to that of pl in other contexts.
For the above example the output file would be named scat.png .
Prefabs allow quick looks at data, but there are often details that would be nice to control but can't be adjusted because there is no command line parameter to do so. One way to proceed is to copy a prefab script to your own directory and then modify your copy as needed. Another option is to make a new prefab variant in the prefabs directory.
If you just want different defaults for a prefab, you can create a shell script that invokes the prefab as you want it. Then, since parameters are taken from left to right, you can put a $* at the end of the pl command, to pick up any overrides that the shell script user enters on the command line.
A number of examples are included for each prefab.
The command that was used to produce each one is shown (the
command line options -gif -scale 0.7 -tightcrop were also used
but are omitted for brevity).
All of the examples may be demonstrated by going to the
prefabs directory (the command echo $PLOTICUS_PREFABS will show
the name of that directory), and entering the given command.
The following pl command line options may be very useful with prefabs: -scale, -color, -backcolor, -tightcrop, and perhaps -font.
Be careful not to confuse prefab parameters with pl command line options . Prefab parameters are given this way: paramname=value. Command line options are given this way: -option or -option value.
Most shells allow a backslash (\) for breaking up long commands into two or more lines.
You can get a multi line title by splitting it over two lines, eg:
pl -prefab pie1 data=data1 fld=3 label=1 title="Travel expenditures By department Fiscal year 2000"
STANDARD PARAMETERS FOR PREFABSThe following parameters are accepted by all prefabs unless otherwise stated. The data parameter is always required.
USER-CONTRIBUTED PREFABSUser-contributed prefabs are welcome and may be sent to email@example.com; please include the prefab script file and a man page giving at least one working example.
data display engine
Copyright Steve Grubb