[R] 3d cube with labels along axes

From: jonne <newsreader_at_zutt.org>
Date: Fri 02 Sep 2005 - 00:05:34 EST


Hi R-users,

I would like to draw a cube with a grid on it and labels along all three axes. I have trouble printing the labels correctly. My best attempt is described below.

   Can somebody explain me how I can change the 0,20,40,80,100 along the x axis into character vectors like "no", "light", "intermediate", "severe" ?

x <- seq(0, 100, length=10)
#x <- c("no", "light", "intermediate", "severe")

y <- x
f <- function(x,y) { numeric(length=100) + 5 }
z <- outer(x, y, f)

P <- persp(x, y, z, theta=30, phi=30, zlim=c(-10,10), ticktype="detailed")

text3d(0, 0, -10, "Hello world", P)

Thanks in advance,
Jonne.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Sep 02 00:32:29 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:01 EST