Friday, December 9, 2011

R multiple plots in one PNG file

library(Cairo)
CairoPNG('foo.png', width=1200, res=72) # CairoPDF('foo.pdf') # use PDF for crispier images
par(mfrow=c(2,3))
for (i in c(1:6)) { plot(sample(100)) }
dev.off()

No comments: