Skip to content
Prev 10077 / 15075 Next

XQuartz

Hi Paul,

Rather than use XQuartz, avoid "printing" the image and use the
pdf()/def.off() commands. Here's an example that I think answers your
question:

for(i in 1:10){
x <- i*1:10
y <- sqrt(x)
pdf(paste("File",i,".pdf",sep=""))
plot(x,y, main = paste("Test Case",i),type = 'l')
dev.off()
}

Note that the paste function gives you the file name within the pdf
function. Check out the ?pdf file to see how to change the width,
height, or file type.

If you are using ggplot2, ggsave can do similar things.

Does this help?

Richard
On Tue, Sep 24, 2013 at 12:01 PM, Paul Ossenbruggen <pjo at cisunix.unh.edu> wrote: