[R] pdf() black&white; panel titles in lattice

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Jul 15 22:01:39 CEST 2005


On 7/15/05, Chuck Cleland <ccleland at optonline.net> wrote:

> ftorrei2 at uiuc.edu wrote:
> > Thank you so much for your help. Now I think I can use R for
> > everything I need so far. However I think that I haven't found
> > a solution for my first question. trellis.device(color=F) only
> > affects the trellis device, but not the pdf device, doesn´t
> > it? At least that is my impression. I manage to get black and
> > white graphics in trellis, but whenever I switch on the pdf
> > device, the resulting pdf file is in color, even if I specify
> >  pdf(X.pdf, bg="white", fg="black") (I wonder what the use of
> > bg and fg is). The thing is that I need black and white
> > graphics for my papers. I am using R on OSX. Does this happen
> > to anyone else?
> 
> Call trellis.device() after pdf() and use new=FALSE in trellis.device().
> 
> pdf("c:/myfolder/myfigures.pdf")
> trellis.device(new=FALSE, col=FALSE)

That will work too, but the intended usage of trellis.device as a
wrapper for any device, including pdf. E.g.,

trellis.device(pdf, file = "foo.pdf", color = FALSE) 

Deepayan




More information about the R-help mailing list