SCAT

Section: Misc. Reference Manual Pages (1L)
Updated: 1. April 1989
 

NAME

scat - line drawings with points or labels, based on data  

SYNOPSIS

scat [ -x m,n,l ] [ -y m,n,l ] [ -w m,n,l,o ] [ -X text ] [ -Y text ] [ -H text ] [ -F "x format" ] [ -F "y format" ] [ -c ] [ -h ] [ -e ] [ -E ] [ -l name ] [ -L name ] [ -d number ]  

DESCRIPTION

scat (scattergram) reads data from the standard input to generate plot(5) commands on the standard output. These can be read by the plot(1) filters to produce a graph on the desired device.

Scat is designed so that running it with no options at all will result in a useful, though possibly not-so-pretty graph, and the options deal mostly with making the graph look nicer.

Data must be in columns, with a single tab character between columns. A missing value is thus denoted by two tabs. The first column is taken to be the X-axis and is therefore assumed to be numeric.

The first line of the data must contain column names, separated by tabs. The second line consists of dashes, to separate the first line from the data.

This is best explained by way of an example:

xcol    y       z       v       u       w       i
-       -       -       -       -       -       -
0       1       2       3       4       *       6
1       2       3       4       5       **      7
2       3       4       5       6       ***     8
3       4       5       6       7       v       9
4       5       6       7       8       vi      10

When no options are given, scat assumes that the user wants a single figure, where each column after the first is plotted against the first.

In the simplest case, e.g. with only the xcol and y columns above, and no options, scat will draw lines through the points (xcol,y), using the data to compute bounds for the graph, no figurecaption will be given, and the column names, "xcol" and "y", will be used as axes labels.

In the above example, the w column is nonnumeric, so an option must be given to indicate it as a label column. The labels will be placed at the points (xcol,u). All the other columns will be plotted against xcol.

When a y-value is missing, no line will be drawn through that point (i.e. two line segments will be skipped). A missing value for a label is simply ignored.  

OPTIONS

Options are quite numerous and follow the strict Sys V format.

-x m,n,l
Numerical bounds on the horizontal axis (minimum, maximum and interval width). If missing, bounds based on the data will be used.
-y m,n,l
Corresponding bounds for the y axis.
-w m,n,l,o
Window bounds (minx, miny, maxx,maxy). These define the region of the plot to be used for the figure. For example, to plot in the upper right quadrant use: -w 0.5,0.5,1.0,1.0 . If missing, (0,0) to (1,1) is used. (0,0) is the lower left hand corner.
-X text
Text for X axis. If missing, the name of the first column is used. text can be an arbitrary string (within quotes, if needed).
-Y text
Text for Y axis. If missing, the name of the second column is used.
-H text
Figurecaption. Text to be placed above the figure. If missing, no figurecaption is given.
-F xformat
Format for numbers on x axis. For example, -F "x %.2f" will result in the numbers on the x axis having two digits after the decimal place. If missing, a fixed default format is used.
-F yformat
Format for numbers on y axis.
-c
Use colors. If not used, dashed and dotted lines will be used to distinguish between different columns in the input.
-E
Use extensions to the plot(5) command set. This is needed in order to accommodate rotation of text (y-axis) and centering of labels (header, x-axis and points), none of which is supported in the base command set.
-e
Don't erase before plotting. This is useful when several pictures are to be plotted on the same piece of paper (or screenfull or...). In this case, the -e option is used for all figures after the first one.
-l name
Name of y column not to draw lines for. This will result in small points being drawn for each (x,y) pair, unless a label column is specified for this y-column. The default is always to draw lines between points.
-L name
Name of label-column. When used, column name must contain labels to be used. These labels will be placed at points (x,y), where x is taken from the first column and y is the column preceding the column name.
-d number
Debug level. Higher levels give more output.
 

SEE ALSO

plot(1), plot(5)  

BUGS

Scat stores all points internally. Strictly speaking this is not needed when the data bounds are given, but that would require quite a bit of reprogramming.

The methods of setting up the default axes should be replaced by one which gives reasonable numbers by default. The current method uses the absolute maximum and minimum from the data. This tends to give ridiculous numbers, although they will of course handle the figure.

As scat is tied to the plot(5) command set, it cannot do miracles. Simple extensions to this command set do wonders, however. These have been implemented in the filters in this distribution and will be used when the -E option is used in scat.