[R] png misbehaving with levelplot when inside a loop

2008-05-02 Thread David
I want to use spplot inside a loop to itteratively produce png files. for (i in 1:5){ png(file=paste(myPlot,i,.png,sep=),bg=white,height=500,width=500) library(lattice) trellis.par.set(sp.theme()) # sets bpy.colors() ramp data(meuse) coordinates(meuse) - ~x+y l2 =

Re: [R] png misbehaving with levelplot when inside a loop

2008-05-02 Thread Paul Hiemstra
Hi David, Putting a print statement around your spplot command solves your problem. This behaviour is common for trellis graphics plot methods (such as spplot). This is the command including print: print(spplot(meuse, c(ffreq), sp.layout=list(l2,l3,l4,l5),col.regions=black,pch=c(1,2,3),