One thing that I did not mention is that my themes contain additional settings 
(like margin definitions). By looking at the code of trellis.device, it look 
like the operation of this function can be simplified a device opening followed 
by a trellis.par.set call. Am I correct?
If so, I think I could replace my trellis.device call by the sequence 
png("foo.png", bg="transparent") / trellis.par.set(mytheme).

Sebastien

----- Mail Original -----
De: "Deepayan Sarkar" <deepayan.sar...@gmail.com>
À: pomc...@free.fr
Cc: r-h...@stat.math.ethz.ch
Envoyé: Mercredi 5 Août 2009 13h16:54 GMT -05:00 USA/Canada - États de l'Est
Objet: Re: [R] Transparency and trellis device

On 8/5/09, pomc...@free.fr <pomc...@free.fr> wrote:
> Hi Deepayan,
>
>  Thank for you reply.
>  I am a little bit confused now. In the one hand, the trellis.device function 
> has lost his bg argument as explained in the Note section of ?trellis.device, 
> but the background info provided by a theme does not seem to impact the 
> background of the device. In the other hand, png has a bg argument that works 
> great but no "theme" capabilities as far as I could see.
>
>  Do you see a way to reconcile both sides of the problem?

There's no conflict. The "bg" argument of png() (and most other
devices) is a "canvas color" that is handled by the device driver. The
lattice "background" setting controls a background rectangle plotted
by lattice:

png("foo.png", bg = "transparent")
xyplot(1 ~ 1, par.settings = list(background = list(col = "yellow")))
dev.off()

Obviously, plotting a transparent rectangle over a white canvas (which
you were effectively doing) will not make the canvas transparent.

-Deepayan

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to