[R] Q: obtaining non-transparent background in png

D. R. Evans doc.evans at gmail.com
Tue Jul 31 18:22:40 CEST 2007


I am not understanding something about generating PNG plots.

I have tried several ways to obtain something other than a transparent
background, but nothing I've done seems to change the background.

For example:

dev.print(png, width=800, height=600, bg='red', filename='example.png')

which I thought would give a red background, simply gives the same
transparent background I always get.

And I also don't understand why the default background is transparent,
when the documentation seems to say that it's white:
  png(filename = "Rplot%03d.png", width = 480, height = 480,
         pointsize = 12, bg = "white",  res = NA,...)

(This is on a Kubuntu dapper 64-bit system.)

[I looked through the mail archives, and there seem to be a few very
old postings talking about the opposite problem, but nothing recent;
so I conclude that I'm doing something wrong.]



More information about the R-help mailing list