[S] Straight lines appear wavy with "perspp"

Spencer B. Graves (sgraves@prodsyse.com)
Wed, 13 May 1998 14:14:13 -0500


plot.persp.test <- function(){
# A straight line appears unacceptably wavy in an S-PLUS
# perspective plot (S-PLUS 3.3 or 4.0 under Windows 95).
# 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. Eliminating
# redundancy in straight line segments is not acceptable
# because the problem also affects curves.
#
# 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)
}
Thanks,
Spencer Graves

****************************************
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