.BG
.FN persp
.TL
Three-Dimensional Perspective Plots
.CS
persp(z, eye=c(-6,-8,5), ar=1)
.AG z
matrix of heights given over a regularly spaced grid of `x'
and `y' values, i.e., `z[i,j]' is the height at `x[i],y[j]'.
Although `x' and `y' are not input to `persp', the algorithm
plots as if `x' and `y' are in increasing order and equally
spaced from `-1' to `1'.
.AG eye
vector giving the `x,y,z' coordinates for the viewpoint.
Since the implied `x,y' grid ranges
from `-1' to `1', the `x,y' coordinates of `eye' should not both
be in the range from `-1' to `1'.
.AG ar
aspect ratio of the actual `x,y' grid,
i.e.,
.Co "(xmax-xmin)/(ymax-ymin)" .
.PP
`persp' sets up the plot under the assumption that a unit in the `x',
`y,' and `z' directions represents the same physical size.  Thus the
values in `z' should ordinarily be scaled to the range `(0,1)'.
.PP
The algorithm attempts hidden-line elimination, but may be
fooled on segments with both endpoints visible but the middle obscured.
.EX
persp(z)   #perspective plot of heights z
           #from default viewpoint
#the example plot is produced by:
i <- interp(ozone.xy$x,ozone.xy$y,ozone.median)
i$z <- ifelse(is.na(i$z),0,i$z)
persp(i$z/200)
title(main="Median Ozone Concentrations in the North East")
.PI
.KW multivariate
.KW hplot
.WR
