Re: [R] 3d cube with labels along axes

From: Felipe Csaszar <fcsaszar_at_gmail.com>
Date: Fri 02 Sep 2005 - 17:16:04 EST

This may work:

- use option axes=F in persp
- use locator() to get the coordinates where you want to put your new labels
- use text(x,y,...) to write your new labels

It is a little bit tedious, but it should work. Regards,

Felipe

"jonne" <newsreader@zutt.org> wrote in message news:pan.2005.09.01.14.05.34.548177@zutt.org...
> 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
>



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 23:50:51 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 16:17:34 EST