[R] Windows BMPs: Why grey background? How to display BMP in R?

Earl F. Glynn efg at stowers-institute.org
Tue Feb 8 18:35:22 CET 2005


"white" is supposed to be the default background for BMPs (according to
?bmp) but it doesn't work



> bmp("test.bmp", bg="white")

> plot(0)

> dev.off()

# results in grey background



# This seems to be a good enough workaround for now.

> bmp("test.bmp")

> par(bg="white")

> plot(0)

> dev.off()

# background is white



Should bmps have been fixed when jpegs with a similar grey background were
fixed for Windows?  http://tolstoy.newcastle.edu.au/R/devel/04/10/0914.html

>> jpeg("test.jpeg", bg="orangered")
>> plot(1:10, 1:10, col="green")
>> dev.off()

>There was a Windows-specific bug, for which I've just committed a fix



How can I display a bmp directly in R?



When plotting 100,000+ points (common with flow cytometry data) [or even the
10,000s of points with microarray data] the Windows metafile is not the way
to go (nor is postscript) because the files are too large and repainting
them takes too long.  Does  R provide a way to plot to a bmp and then
display that graphic immediately?  It's a pain to leave R just to view the
graphics.



JPGs work fine for real world images, but not that well for drawings.  BMPs
look like the only alternative when plotting a huge number of points so the
file size is reasonable.  (GIFs with drawings would be even better than
BMPs.  I guess I could try PNGs.)



With the GIF/LZW patent issue now in the past, why not have a GIF driver and
even support creation/display of some simple animated GIFs in R?



Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research




More information about the R-help mailing list