[R] Saving multiple plots using tiff function

Berend Hasselman bhh at xs4all.nl
Thu Apr 12 13:34:53 CEST 2012


On 12-04-2012, at 13:07, John S wrote:

> Dear R users,
> 
> I still did not receive an answer to my question and went through the
> archive with no luck.
> 
> So what does tiff(filename ="Rplot%03d.tif") mean ?


Just read the documentation for tiff: ?tiff

> Why the following code
> does produce two files?
> 

It produces no files for me.
Only an error message.

> 
> tiff(filename ="Rplot%03d.tif",width=24,height=20,units="cm",res=300,
> pointsize=10, compression = "lzw")
> 
> plot(1)
> 
> mtext("Fig 1",side=3,line=4,adj=0.50,padj=2,col="black",cex=1)
> 
> plot(2)
> 
> mtext("Fig 2",side=3,line=4,adj=0.50,padj=2,col="black",cex=1)
> 
> plot(3)
> 
> mtext("Fig 3",side=3,line=4,adj=0.50,padj=2,col="black",cex=1)
> 
> dev.off()
> 

You must specify the antialias argument.
Which I did: I set it to "none" and got 3 .tif (plot) files.
So I don't know what's wrong with your stuff.

Berend



More information about the R-help mailing list