scat1 - 2-D scatterplot |
With prefabs one can avoid creating or editing ploticus scripts for many common styles of plots, at the expense of some flexibility. The user invokes the -pre command line option and supplies several key parameters on the command line as var=value pairs and/or within the data file.
For example: pl -pre scat1 -png datafile=results.dat x=2 y=4
The various prefabs are stored as ordinary ploticus scripts in a ./prefabs directory pointed to by the PLOTICUS_PREFABS environment variable. Normally this is in the directory where ploticus is installed, but it could also be a user's directory of customized prefab scripts.
This manual page describes all of the available prefabs, and the parameters to be supplied by the user.
They may also be embedded in an input data file, using the #set construct:
#set x = 2 #set y = 3 #set title = Correlation of WBC vs. T-Chol
Either method will implicitly #declare the variable.
Any of the pl command line options may be used with prefabs. In particular, the
-scale option may be useful.
![]() | ![]() |
The first example above was produced using this command:
pl -gif -pre scat1 datafile=data1 x=2 y=3The second was produced using this command:
pl -gif -pre scat1 datafile=data1 x=2 y=3 id=1 \ xlbl="Total Ch" ylbl="White Blood Cell Count" correlate=yesWe used the additional command line options -scale 0.7 -tightcrop. You can try it yourself (the data file is in the directory $PLOTICUS_PREFABS).
Required parameters:
datafile - the name of the user's data file, or stdin
x - the field holding values in X
y - the field holding values in Y
Optional parameters:
title - plot title to be centered at top
id - a field holding an identifier
xlbl - a text label for the X axis
ylbl - a text label for the Y axis
correlate - if specified (yes), correlation and regression will be done