[Rd] grid graphics gpar(fill) argument and jpeg device

From: Florian Hahne <f.hahne_at_dkfz.de>
Date: Thu 08 Dec 2005 - 19:22:11 GMT


Hi everybody,
I just notice a strange behaviour of gpar's fill argument when using non-postscript devices:
The default of the argument is transparent (according to get.gpar("fill")). So as expected, the following code draws a nice red rectangle in the middle of my X11 or postscript device.

pushViewport(viewport(width=0.5, height=0.5)) grid.rect(gp=gpar(fill="red"))
grid.rect()

However, when plotting on a jpeg device (or any other pixel device), the output of the above code is an empty (=white) rectangle. Obviously the second grid.rect() which should produce a transparent rectangle turns out to be filled white on the jpeg device. When I set the fill argument to NA, the second rectangle is transparent as it is supposed to be.

grid.rect(gp=gpar(fill="red"))
grid.rect(gp=gpar(fill=NA))

Is this a bug or a feature???
I'm using R version 2.2.0 on a SUSE 10.0 linux machine.

Cheers,
Florian



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Dec 09 06:38:18 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:34 GMT