On Thu, Mar 12, 2009 at 03:06:30PM +0000, Mohan Singh wrote: > I am trying to print graphs as pdf's or eps in a for loop, but I can't seem > to get it right > > > > Either it prints only a single eps graph (overwrites) or when I use > #pdf(paste(i,".pdf", sep="")) .. it prints all pdf's but they are empty
Did you remember to close the pdf files? Something like the following should work: x <- seq(0, 10, 0.01) for (i in 1:5) { pdf(paste('plot', i, '.pdf', sep='')) plot(x, x^i) dev.off() } cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Universität München Wissenschaftszentrum Weihenstephan 85350 Freising, Germany http://mips.gsf.de/staff/pagel ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.