.BG
.VE $Header: /usr3/s/current/s/.help/RCS/persp,v 1.2 83/12/30 19:31:55 rab Exp $
.FN persp
.TL
persp: 3-Dimensional Perspective Plots
.CS
persp(z, eye, ar)
.PP
.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.
Default is `c(\-6,\-8,5)'.  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., (`xmax'\-`xmin')/(`ymax'\-`ymin').
Default 1.
.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(NA(i$z),0,i$z)
persp(i$z/200)
title(main="Median Ozone Concentrations in the North East")
.PI
.KW plot*
.KW multivariate
.KW hplot*
.WR
