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

David Winsemius dwinsemius at comcast.net
Sat Nov 13 21:25:12 CET 2010


On Nov 13, 2010, at 3:16 PM, Shige Song wrote:

> 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.

You do  not seem to be reading for meaning (and are still not offering  
a workable example) . The plotting function "plot" is not a lattice  
function. Why should the output of plot to the tikzDevice be modified  
by a call to a lattice?

-- 
David.
>
> 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
>>
>>

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list