[S] Straight lines appear wavy with "perspp"

Spencer B. Graves (sgraves@prodsyse.com)
Thu, 21 May 1998 11:02:48 -0500


Straight lines and gentle curves appear unacceptably wavy
in an S-PLUS perspective plot (S-PLUS 3.3 or 4.0 under
Windows 95). This is illustrated by the following function
"plot.persp.test".

Thanks,
Spencer Graves

Any suggestions on how to get around this?
******************
plot.persp.test <- function(){
# A straight line appears unacceptably wavy in an S-PLUS
# perspective plot. I've traced the problem to excessive
# round off in a single precision Fortran function, but I
# don't know enough about the algorithm to correct it.
#
# How can I get around this problem?
#
z0 <- array(c(0, 0, 1, 1), dim = c(2, 2))
persp0 <- persp(x = c(0, 1), y = c(0, 1), z = z0)
x1 <- seq(0, 1, length = 99)
persp1 <- perspp(x = x1, y = x1, z = x1, from.persp = persp0)
lines(persp1)
persp1 <- perspp(x = x1, y = x1^2, z = x1, from.persp = persp0)
lines(persp1)
}

****************************************
Spencer Graves, PhD, statistician and engineer improving productivity.
Productive Systems Engineering, 751 Emerson Ct., San Jose, CA 95126,
http://www.prodsyse.com, tel: (408)294-5779 / fax: (408)294-2343, and
Univ. of Wisconsin Center for Quality and Productivity Improvement,
610 Walnut St., Madison, WI 52705, tel:(608)263-2652, fax:(608)263-1425
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news