|
Available prefabs
Also available: draw , a prefab for interpreting ploticus draw commands. 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.
Ploticus must be supplied with the full pathname of the directory where your
prefab files reside.
This may be hard-coded at build time (settable in the Makefile as PREFABS_DIR),
or via an environment variable called PLOTICUS_PREFABS.
If the environment variable is found it overrides the hard-coded path name.
Prefabs are intended to cover common, straightforward situations.
The tradeoff, as usual, is convenience vs. flexibility & power.
Higher degrees of customization
will require that you write a ploticus script, or develop your own prefab
(see CUSTOMIZATION below).
Parameters
Parameters may be supplied on the pl command line as var=value pairs as seen in the above example. Some parameters are standard (recognized by most of the prefabs) ; others are specific to individual prefabs, and are described on the individual prefab man pages. If convenient, most parameters may 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 .
Plot dataPlot data must be located in a file. The name of the data file is given in the data= parameter the data field delimitation method may be given in the delim= parameter . See dataformat for more information on acceptable data formats. Missing data fields are generally skipped, but this depends on what kind of plot is being generated. See dataformat for more discussion of missing data.CustomizationPrefabs 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, put a $* at the end of the pl command to pick up any overrides that the shell script user enters on the command line (if a parameter is given twice, the rightmost is taken). Examples
All prefab examples are included in the ploticus test suite that is included
with all distributions (2.02 and later).
HintsYou can create a ploticus config file and use it to set prefab parameters that you always want to be in effect. For example:option: comment=# option: delim=comma The following pl command line options may be very useful with prefabs: -scale, -color, -backcolor, -tightcrop, -map, -debug, 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"
HTML clickmaps
may be generated using the prefab
clickmapurl standard parameter
.
User-contributed prefabsUser-contributed prefabs are welcome and may be sent to scg@jax.org; please include the prefab script file and a man page giving at least one working example. |
![]() data display engine Copyright Steve Grubb ![]() |