[R] lattice grayscale "theme"

Patrick Drechsler patrick at pdrechsler.de
Tue Jul 31 01:28:21 CEST 2007


The Gmane interface seems to have some lag at the moment...

"Deepayan Sarkar" <deepayan.sarkar at gmail.com> writes:

> On 7/28/07, Patrick Drechsler <patrick at pdrechsler.de> wrote:
>>
>> is there a grayscale setting for lattice plots?
>>
>> I like the default color settings. I also like the settings that are
>> available for setting black and white with something like this:
>>
>> --8<---------------cut here---------------start------------->8---
>> ltheme <- canonical.theme(color = FALSE)      ## in-built B&W theme
>> ltheme$strip.background$col <- "transparent" ## change strip bg
>> lattice.options(default.theme = ltheme)      ## set as default
>> --8<---------------cut here---------------end--------------->8---
>>
>> Is there a simple way of achieving something in between these settings
>> (using grayscales for the default colors)?
>
> Possibly, but you would have to define what you mean by 'simple' and
> 'something in between' more precisely. 

Here is an example of 'in between':

--8<---------------cut here---------------start------------->8---
  ## Set background color of strips to grayscales:
  strip.background <- trellis.par.get("strip.background")
  trellis.par.set(strip.background = list(col = grey(7:1/8)))
  ## Set color of plot symbols to grayscale:
  plot.symbol <- trellis.par.get("plot.symbol")
  trellis.par.set(plot.symbol = list(col = grey(5/8)))
--8<---------------cut here---------------end--------------->8---

I think it would be nice to have a few default "themes": A single
switch between "default color", "grayscale" and "black and white".


What do you think?

Cheers,

Patrick 
-- 
We are sorry, but the number you have dialed is imaginary.
Please rotate your phone 90 degrees and try again.



More information about the R-help mailing list