[R] How to put different color in some portion of a surface plot?

From: Megh Dal <megh700004_at_yahoo.com>
Date: Tue, 06 May 2008 07:31:16 -0700 (PDT)


Hi all,    

  I have following problem :    

  a = b = seq(1, 50000, by=500)
v = matrix(0, nrow=length(a), ncol=length(a)) for (i in 1:length(a))

   {
    for (j in 1:length(a))

       {
        d = c(17989*a[i], -18109*b[j])
        v[i,j] = t(d) %*% matrix(c(0.0001741, 0.0001280, 0.0001280, 0.0002570), nrow=2) %*% d
       }

   }
library("rgl")
open3d()
persp3d(a,b,v,col="green",alpha=0.7,aspect=c(1,1,0.5))    

  Now I want to shed the portion with different color of the surface which satisfy following condition:    

  0 < (a-b) < max(a)    

  Can anyone please tell me how to do that?    

  Regards,        



[[elided Yahoo spam]]

        [[alternative HTML version deleted]]



R-help_at_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. Received on Tue 06 May 2008 - 14:38:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 06 May 2008 - 16:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive