[R] no transparent background in bmp

Deepayan Sarkar deepayan at stat.wisc.edu
Fri May 28 01:16:56 CEST 2004


On Thursday 27 May 2004 17:24, Jeff D. Hamann wrote:
> I've been attempting to export a graphics file of my lattice plots
> and no matter what color I use for the bg= argument in the
> bmp/jpeg/png function, the background is grey.
>
> bmp(filename = "c:/my_paper/resids.bmp", width=1024, height=1024,
> pointsize=10, bg="transparent")

This doesn't affect lattice's own settings, which is what's going to be 
used. You should instead use

trellis.device(bmp, 
               filename = "c:/my_paper/resids.bmp", 
               width=1024, height=1024,
               pointsize=10, # probably useless
               bg="transparent")

or call 

lset(list(background = list(col = "transparent")))

after the bmp device is opened using bmp() directly. 

(this works for me with png at least, my installation doesn't seem to 
have a bmp device)

Deepayan




More information about the R-help mailing list