Contour Plot

DESCRIPTION:
Represents a third dimension in a plot by means of contour lines. Either a new plot is created, or the contours are added to the current plot.

USAGE:
contour.old(x, y, z, v=<<see below>>, nint=5, add=F, labex=<<see below>>)

REQUIRED ARGUMENTS:
x:
vector containing x coordinates of the grid over which z is evaluated.
y:
vector of grid y coordinates.
z:
matrix of size length(x) by length(y) giving the surface height at grid points, i.e., z[i,j] is evaluated at x[i], y[j]. The rows of z are indexed by x, and the columns by y. Missing values (NAs) are allowed.

The first argument may be a list, xyz, say. Components xyz$x, xyz$y and xyz$z will be used. In particular, the result of interp is suitable as an argument to contour.old.


OPTIONAL ARGUMENTS:
v:
vector of heights of contour lines. By default, approximately nint lines are drawn which cover most of the range of z. See the function pretty.
nint=:
the approximate number of contour intervals desired. This is not needed if v is specified.
add=:
logical flag: if TRUE, contour lines are added to the current plot. Use this to add contours with a different labex parameter, line type, etc., or to add contours to some other type of plot.
labex=:
the desired size of the labels on contour lines. By default the current character size is used. If labex is 0, no labels are plotted on contours.

Graphical parameters may also be supplied as arguments to this function (see par). In addition, the high-level graphics arguments described under par and the arguments to title may be supplied to this function.


SIDE EFFECTS:
a new plot is created, or contour lines are added to the current plot.

BUGS:
It is possible in some extreme cases for contour lines to cross when this function is used. This is one of the reasons to prefer the contour function.

SEE ALSO:
contour , interp , persp , image , par , title .

EXAMPLES:
rx <- range(ozone.xy$x)
ry <- range(ozone.xy$y)
usa(xlim=rx, ylim=ry, lty=2, col=2)
i <- interp(ozone.xy$x, ozone.xy$y, ozone.median)
contour.old(i, add=T, labex=0)
text(ozone.xy, ozone.median)
title(main="Median Ozone Concentrations in the North East")