[R-SIG-Mac] Weird problem redirecting lattice graph to a file

Thomas Lumley tlumley at u.washington.edu
Mon Aug 14 16:18:07 CEST 2006


On Sun, 13 Aug 2006, Jorge A. Ahumada wrote:

> Hello,
>
> I am having this weird issue where I cannot send a lattice graph to a device
> like pdf() or png(), but this only happens when the statement is inside a
> function. For example, this works:

It's a FAQ.

    7.22 Why do lattice/trellis graphics not work?


 	-thomas


>> a <- matrix(0,5,5)
>> pdf("test.pdf")
>> levelplot(a)
>> dev.off()
>
> But now, put the last three statements in a function (F(a)) and the pdf is
> not produced. I tried replacing pdf with
> trellis.device(device="pdf",file="test.pdf") and it still does not work.
>
> Funny thing is that plot() or image() will work inside a function as
> expected when re-directing to other devices, but not any of the lattice
> functions.
>
> Any ideas?
>
> Thanks,
>
> Jorge
> -- 
> Jorge A. Ahumada, Ph.D.
> Technical Director, TEAM
> Center for Applied Biodiversity Science
> Conservation International
> 1919 M Street, NW Suite 600
> Washington, DC 20036-3521
> Ph: 202-912-1516
>
> j.ahumada at conservation.org
> http://www.teaminitiative.org/
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-SIG-Mac mailing list