[R] different colors for two wireframes in same plot

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Sep 27 13:55:48 CEST 2007


On Thu, 27 Sep 2007, Frede Aakmann Tøgersen wrote:

> You can obtain some transparency setting the alpha transparency. This is 
> device dependent though. Using the pdf device you can do this obtaining 
> transparency of both surfaces (the version must be at least 1.4 for 
> semitransparent output to be understood):

In any recent version of R ?pdf says

  version: a string describing the PDF version that will be required to
           view the output.  This is a minimum, and will be increased
           (with a warning) if necessary.

so you don't actually _need_ to specify the version.  (This came up in a 
thread about ggplot2 and Sweave as well.)

>
>
> pdf("test.pdf",version="1.4")
> wireframe(z ~ x * y, data = g, groups = gr,
>          scales = list(arrows = FALSE),
>          drape = TRUE, colorkey = TRUE,
>          screen = list(z = 30, x = -60),
>          par.settings = list(regions=list(alpha=0.75)))
> dev.off()
>
> See ?wireframe for the "at, col.regions, alpha.regions" arguments.
>
> Does this suffice?
>
>
> Med venlig hilsen
> Frede Aakmann Tøgersen
>
>
>
>
>> -----Oprindelig meddelelse-----
>> Fra: r-help-bounces at r-project.org
>> [mailto:r-help-bounces at r-project.org] På vegne af marcg
>> Sendt: 27. september 2007 09:22
>> Til: r-help at stat.math.ethz.ch
>> Emne: [R] different colors for two wireframes in same plot
>>
>> Hello R,
>>
>> According to:
>>
>> g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <-
>> log((g$x^g$g + g$y^2) * g$gr) wireframe(z ~ x * y, data = g,
>> groups = gr,
>>           scales = list(arrows = FALSE),
>>           drape = TRUE, colorkey = TRUE,
>>           screen = list(z = 30, x = -60))
>>
>> i have two wireframes in one plot.
>>
>> How could i change the color of the top - one to transparent
>> (or only the grid). I want to give insight to the lower layer.
>>
>> Could one make an if-statment like (if gr==1 do drape=F or
>> color=none) if gr=2 do drape=T, colorkey=T)
>>
>> Thanks for your help
>>
>> Marc
>>
>> --
>> Psssst! Schon vom neuen GMX MultiMessenger gehört?
>> Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
>>
>> ______________________________________________
>> 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.
>>
>
> ______________________________________________
> 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list