To rotate the graph you can change the viewpoint. Try: ?rgl.viewpoint

library(rgl)
x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x,y)
plot3d(x, y, z, col=rainbow(1000), size=2)
start <- proc.time()[3]
while ((i <- 36*(proc.time()[3]-start)) < 360) {
  rgl.viewpoint(i,i/4); 
}


To define the side which the axes will be displayed, try: ?axes3d

library(rgl)
x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x,y)
plot3d(x, y, z, col=rainbow(1000), size=2,axes=F)
axes3d(c('x--','x+-','x++','x-+','z--','y++'))

hth,

________________________________________
Daniel Moreira, MD




Leah Gerber <leahger...@yahoo.com> 
Sent by: r-help-boun...@r-project.org
03/22/2009 09:07 PM

To
r-help@r-project.org
cc

Subject
[R] Axes in 3D plots






I am wondering if anyone knows how to change or rotate the default axes on 
a 3D scatterplot. I would like to change which sides of the cube the 3 
axes are displayed on. 

Many thanks,

Leah Gerber 



 
                 [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to