Re: [R] graphics - wireframe

2007-04-13 Thread Greg Snow
If you are just trying to find the best set of rotation values to view
your surface then the rotate.wireframe function in the TeachingDemos
package may help.  Unfortunately it is not currently working out of the
box (a parameter name was changed in the lattice functions, I will fix
this for version 1.6 of TeachingDemos).

You can easily fix the problem and get it working by doing:

> fix(rotate.wireframe)

Then find the line that is currently (line number 31):

wire.options$formula <- formula

And change it to 

wire.options$x <- formula

Then it should work for you.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Churata
> Sent: Friday, April 13, 2007 8:11 AM
> To: [EMAIL PROTECTED]
> Subject: [R] graphics - wireframe
> 
> Hi,
> 
> I would like to know about graphics for response surface in 
> R. What are arguments for a best graphics?
> 
> thanks,
> 
> Bruno
> 
> 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)
> wireframe(  y ~ x1*x2  ,
> scales = list(arrows = FALSE),
> drape = TRUE, colorkey = TRUE,
> screen = list(z = 30, x = -60),  distance = .4, zoom = .8 )
> 
>   [[alternative HTML version deleted]]
> 
> __
> [EMAIL PROTECTED] 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.
>

__
[EMAIL PROTECTED] 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.


Re: [R] graphics - wireframe

2007-04-13 Thread Ben Bolker
Bruno Churata  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

__
[EMAIL PROTECTED] 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.