Re: [R] Exporting plots generated by a 'for' loop

2012-04-30 Thread Greg Snow
A couple of things that I did not see mentioned by the others: Generally statistics plots work better in .png files than in .jpg files due to the type of compression each uses (detailed image plots and some surface plots may be the exception), though that may be out of your control (some journals

Re: [R] Exporting plots generated by a 'for' loop

2012-04-28 Thread Sarah Goslee
Ah, I misread the querent as wanting four plots of three panels each, not a single plot with three panels. Since that's not true, Jim's is the best solution (but mind the missing commas in the iris subsets). Sarah On Apr 28, 2012, at 8:28 AM, Jim Lemon wrote: > On 04/28/2012 08:40 PM, Tejas K

Re: [R] Exporting plots generated by a 'for' loop

2012-04-28 Thread Jim Lemon
On 04/28/2012 08:40 PM, Tejas Kale wrote: Hello! I have a 'for' loop that generates a plot with each iteration. I would either like the plots to be stacked one below the other in a single .jpg file or be stored in three different files with each file being named dynamically. The following code i

Re: [R] Exporting plots generated by a 'for' loop

2012-04-28 Thread Sarah Goslee
I don't think jpeg supports pages, but you have other options, including one you asked about: Use a device like pdf() that supports pages and don't call dev.off() until the loop has finished. Use paste() to give each graph a separate name, rather than overwriting them at each iteration, such as

[R] Exporting plots generated by a 'for' loop

2012-04-28 Thread Tejas Kale
Hello! I have a 'for' loop that generates a plot with each iteration. I would either like the plots to be stacked one below the other in a single .jpg file or be stored in three different files with each file being named dynamically. The following code is an illustration of my query (but does not