[R] How to turn the colour off for lattice graph?

Shige Song shigesong at gmail.com
Sat Nov 13 21:16:15 CET 2010


With the following code:
---------------
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
---------------
I was able to get a nice-looking b&w figure from the X11 display but
still cannot get the same thing from tikz output. I guess it's
something about the connection between lattice and tikz that I was
unable to identify.

Shige

On Sat, Nov 13, 2010 at 11:31 AM, David Winsemius
<dwinsemius at comcast.net> wrote:
>
> On Nov 13, 2010, at 10:07 AM, Shige Song wrote:
>
>> Dear All,
>>
>> I am trying to plot a lattice figure and include it in a LaTeX
>> document via the TikZDevice package. I think the journal I am
>> submitting to does not like colour figure, so I need to get rid of all
>> the colours in the figure. If I directly generate PDF or EPS, the
>> option "trellis.device(color=FALSE)", but when I do:
>>
>> trellis.device(color=FALSE)
>> tikz("~/project/figure.tex")
>> plot(...)
>
> I wouldn't expect to see output the plot function affected by modifications
> to the trellis device. Have your tried using par()?
>
> (There are plot methods that use lattice plotting functions and I suppose
> tikz might be one but I do not see that function in my loaded packages which
> include lattice by default.)
>
>
>> dev.off()
>>
>> The resulted graph has black and white dots and lines but still has
>> the default colour in the window frame. Any ideas about how to get rid
>> that colour as well?
>>
>> Many thanks.
>>
>> Best,
>> Shige
>
>
>
> David Winsemius, MD
> West Hartford, CT
>
>



More information about the R-help mailing list