.TH CONTOUR L "28 August 1990"
.SH NAME
contour - contour plot program for X-windows, HP2648s and Postscript
.SH SYNOPSIS
.B
contour
[-o \fIoptions-file\fR]
[-P\fIprinter\fR]
[-s \fIscale\fR] 
[-c \fIlevel\fR]
[-e]
[-g]
[-j \fIjoinlevel\fR]
[-l]
[-print]
[-ps]
[-old]
contour-file
.SH DESCRIPTIONS
.PP
\fBContour\fR is a program for drawing contour plots on X10/X11 windows
or HP2648 terminals.  The program will also produce a POSTSCRIPT plot which
can be dumped out to an APPLE Laserwriter. 
\fBContour\fR reads in
data on a 3D surface from a \fIcontour-file\fR and
manipulates that data according to options specified
either in the command-line or in a \fIoptions-file\fR.
The program then draws contours on a screen or dumps the contours 
to a POSTSCRIPT file.  
.PP
The 3D surface input data
consists of z-values of the 3D surface, arranged on a
rectangular grid of size \fI(xmax - xmin)\fR \(mu \fI(ymax - ymin)\fR. 
The data file format is shown below.
.RS
.LP
.B
Data File Format (contour-file)
.LP
.nf
 xmin xmax ymin ymax 
 nxpts nypts
 z1
 z2
 ..
 ..
 ..
.fi
.RE
.LP
In the above, \fIxmin\fR, \fIxmax\fR, \fIymin\fR and \fIymax\fR are
lower and upper bounds of the grid,
and \fInxpts\fR and \fInypts\fR are the number of
grid divisions in x and y.
.LP
Upon starting up the program, \fBcontour\fR will read in the data stored in
the \fIcontour-file\fR and will then find the maximum and minimum z-values
of the surface.  It will then prompt for a contour step-size (i.e. the
contour increments), and read in any plotting options specified either in
the command line or in the \fIoptions-file\fR.
The plot will then be drawn on the screen if possible.
Finally, the user will be
prompted as to whether or not the POSTSCRIPT plot is to be sent to a printer.
.SH OPTIONS
.TP 5
.B \-o \fIoptions-file\fR
reads plotting options from the file \fIoptions-file\fR.
Each option specification consists of a keyword and its corresponding value.
The parser recognizes only a limited set of keywords; their values are
either numbers, quoted strings, or the words "on" and "off".
All the words in the option specification must be on the same line.
The pound sign (#) indicates that the remainder of the line is a comment to
be ignored by the parser.
.RS
.LP
.B
List of Options (options-file)
.RS
.LP
xlabel "LABEL" 	#[default = "X-AXIS"] 		- for the x-label   
.br
ylabel "LABEL" 	#[default = "Y-AXIS"] 		- for the y-label
.br
toplabel "LABEL" 	#[default = "CONTOUR PLOT"] 	- for the top-label  
.br
grid on/off 		#[default = off] 			- draws a grid   
.br
equalscale on/off 	#[default = on] 			- for equal x-y scaling 
.br
postscript on/off 		#[default = on] 			- for postscript (PS) plot 
.br
printplot on/off 		#[default = on] 			- send PS file to printer 
.br
printer "PRINTER"	#[default = $PRINTER]		- define the printer
.br
contlabel on/off		#[default = on]			- for contour labels
.br
joinlevel high/low	#[default = --]			- for joining curves
.br
scale [0.1 - 1.0] 		#[default = 1.00] 		- scales the PS plot  
.br
linetypes [1 - 3] 		#[default = 2] 			- no. of contour linetypes
.br
xticks [1 - 20] 		#[default = 4] 			- no. of x-divisions  
.br
yticks [1 - 20] 		#[default = 4] 			- no. of y-divisions   
.RE
.RE
.TP 5
.B \-P\fIprinter\fR
specifies which printer to which to send the postscript plot.
The current default sets the printer name to the environment variable
$PRINTER.
If this variable is not set, then the printer used is
the lp550M printer in 550M Cory.
.TP 5
.B \-s \fIscale\fR
sets a scale factor.  This is used only for POSTSCRIPT plotting.
.TP 5
.B \-c \fIlevel\fR
forces the program to compute the contours at a single 
value of z, specified by \fIlevel\fR.
The contours will be written to the file \fBimage.cont\fR.
The output data is organized in SAMPLE plot format, i.e.,
.RS
.LP
.B
Single contour (image.cont)
.LP
.RS
.nf
 xmin, xmax, ymin, ymax
 ncurves
 npts
 pt1.x pt1.y
 pt2.x pt2.y
 ..
 ..
 ..
 npts
 pt1.x pt1.y
 ..
 ..
.fi
.RE
.RE
.TP 5
.B \-e
expands the data into a triangular mesh.
The mesh is stored in \fIcontour-file\fR.3D.  Thus, if the initial
contour file is named \fIim.cont\fR, then the surface mesh will be
stored in \fIim.cont.3D\fR.
.TP 5
.B \-g
forces a grid to be drawn.
.TP 5
.B \-j \fIjoinlevel\fR
causes contour curves to be joined where possible.  This is done by defining
a boundary layer around the rectangular border, and setting the z-value of
that boundary layer at either the maximum or minimum z-value.
\fIjoinlevel\fR = \fIHIGH\fR or \fIhigh\fR sets the border z-value to its
maximum value: this is useful for plots which have high average z-values.
\fIjoinlevel\fR = \fILOW\fR or \fIlow\fR sets the border z-value to its
minimum value: this is useful for plots which have low average z-values.
.TP 5
.B \-l
suppresses the contour labels.
.TP 5
.B \-print
sends the POSTSCRIPT lot to the printer automatically.
.TP 5
.B \-ps
turns off the postscript plotting mode.
.TP 5
.B \-old
accepts an older contour format for the \fIcontour-file\fR,
based on a rectangular
50 \(mu 50 array.  The data file format is similar to that described
earlier except for the first 3 lines.
\fInxpts\fR and \fInypts\fR (both equal to 50) are omitted.
Also, \fIxmin\fR and \fIymin\fR are the coordinates of the lower
left corner of the grid while \fIxlength\fR and \fIylength\fR define the area
being examined. 
.RS
.LP
.B
Old Data File Format (contour-file)
.LP
.RS
.nf
 xmin ymin xlength ylength
 z1
 z2
 ..
 ..
 ..
.fi
.RE
.RE
.TP 5
.I host:display
opens a window on the given host and display
.TP 5
.B \-d \fIhost:display\fR
.TP 5
.B \=geom 
.TP 5
.B \-rv 
.TP 5
.B \-bw \fIborder-width\fR
.TP 5
.B \-bd \fIcolor\fR 
.TP 5
.B \-fg \fIcolor\fR 
.TP 5
.B \-bg \fIcolor\fR
.TP 5
.B \-fn \fIfont-name\fR
sets input options for the X-window system.
.SH AUTHOR
Kenny K.H. Toh (ktoh@mascot.berkeley.edu)
.SH FILES
\fIdataplot.ps\fR 	temporary POSTSCRIPT file
.br
\fIimage.cont\fR 	file produced by -c \fIlevel\fR option
.SH SEE ALSO
SPLAT, drawplot(L), pdraw(L)
