[R] graphics - wireframe

Ben Bolker bolker at zoo.ufl.edu
Fri Apr 13 18:00:19 CEST 2007


Bruno Churata <bruno.rproject <at> gmail.com> writes:

> 
> Hi,
> 
> I would like to know about graphics for response surface in R. What are
> arguments for a best graphics?
> 

  Thanks for giving a reproducible example [snipped], but it's not clear
what you need to know. Are you wondering whether there are general
design standards for 3d perspective plots?  (There's a little bit
in Cleveland's "Visualizing data".)  I'm afraid the general answer
is "play around with the parameters until you think it looks good".

  You could also try rgl:

y <-  c(66,39,43,49,58,17,-5,-40,65,7,43,-22,-31,-35,-26)
x1 <- c(-1,1,-1,1,-1,1,-1,1,rep(0,7))
x2 <- c(-1,-1,1,1,0,0,0,0,-1,1,-1,1,0,0,0)
library(rgl)
ym = xtabs(y~x1+x2)
persp3d(as.numeric(rownames(ym)),as.numeric(colnames(ym)),ym,
        xlab="x1",ylab="x2",col="gray")

 unfortunately, there's not (yet?) any easy way to get
filled + lines on the surface; using front="line" will
get you a wireframe (see ?rgl.material).

http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-3d:graphics-3d

  good luck
   Ben Bolker



More information about the R-help mailing list