Line Styles for Perspective Plots

DESCRIPTION:
Specifies a line type (e.g, solid, dotted, dashed), a line width, and a color for the three classes of lines (top, hidden, and bottom) in perspective plots.

USAGE:
persp.setup(lty=<<see below>>, col=<<see below>>, lwd=<<see below>>,
     all=<<see below>>, restore=F)

OPTIONAL ARGUMENTS:
lty:
vector of three small positive integers specifying the line type for the top, hidden, and bottom lines, respectively. These are device dependent. If this argument and all are not given and restore is FALSE, then the value is not changed.
col:
vector of three small integers specifying the colors for the three classes of lines on the surface. If this argument and all are not given and restore is FALSE, then the value is not changed.
lwd:
vector of three small positive integers specifying the widths of the lines. 0 means to not draw a class of lines. If this argument and all are not given and restore is FALSE, then the value is not changed.
all:
a list, typically the result of a previous call to persp.setup. This must have the three components lty, col, and lwd. This argument is ignored if restore is TRUE.
restore:
logical flag: if TRUE, the values are restored to their initial values. These values are c(1,1,1) for lty and col, and c(1,0,1) for lwd.

VALUE:
an invisible list with components lty, col, and lwd containing the previous settings of these line style parameters.

SIDE EFFECTS:
subsequent calls to persp will use these line styles.

DETAILS:
The persp function will draw a perspective plot of a surface, z(x,y), with the top, bottom, and hidden parts drawn in contrasting styles. By default, the hidden lines are not drawn, and the lines on the top and bottom of the surface are the same width. persp.setup allows you to change these defaults.

SEE ALSO:
persp .

EXAMPLES:
x <- seq(0, 3*pi, by=.2)
y <- seq(3, 0, by=-.2)
z <- outer(cos(x), exp(-y), "*")

# make lines on the top color 1 and lines on the bottom color 2 # the hidden lines will not be drawn. persp.setup(lty=c(1,1,1), col=c(1,1,2), lwd=c(1,0,1)) persp(z)

# hidden lines with a dotted pattern # the visible lines on the top thicker, all in one color persp.setup(lty=c(1,2,1), col=c(1,1,1), lwd=c(2,1,1)) persp(z)

# look at the current values for the line styles print(persp.setup())

ps.old <- persp.setup(col=1:3) persp(z) persp.setup(all=ps.old) # change back to ps.old values