Re: [R] odfWeave: in multi-page plots only last page appears in document
If you ran that code outside ODFWeave, you'd only get one plot, so why would you expect to get more within ODFWeave? for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } You need to add some sort of par() command, or use layout(), to create a single plot that contains all three of the plots created by the loop. par(mfrow=c(2,2)) for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } for example. Or, if you want ODFWeave to handle placement, then you need to break that into three separate plots. Sarah On Mon, Apr 14, 2008 at 2:20 PM, Tobias Sing [EMAIL PROTECTED] wrote: Dear all, Max, first of all, many thanks for providing the odfWeave package. My problem: Whenever I have multiple plots in one single chunk of my ODF file, only the last plot gets shown. The problem can be reproduced with this toy example (to be used in an ODF file together with odfWeave -- I'm using the newest version 0.7.3): plot1, echo=FALSE, fig=TRUE= for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } @ -- Sarah Goslee http://www.functionaldiversity.org __ 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.
Re: [R] odfWeave: in multi-page plots only last page appears in document
Another option, if you want them in separate figures, is to write a loop that generates the image file, saves it to the file system, and use odfInsertPlot to put the file into the document. This might work better if you have an unknown number of images that you want to insert. Max -Original Message- From: Sarah Goslee [mailto:[EMAIL PROTECTED] Sent: Monday, April 14, 2008 2:32 PM To: Tobias Sing Cc: r-help; Kuhn, Max Subject: Re: [R] odfWeave: in multi-page plots only last page appears in document If you ran that code outside ODFWeave, you'd only get one plot, so why would you expect to get more within ODFWeave? for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } You need to add some sort of par() command, or use layout(), to create a single plot that contains all three of the plots created by the loop. par(mfrow=c(2,2)) for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } for example. Or, if you want ODFWeave to handle placement, then you need to break that into three separate plots. Sarah On Mon, Apr 14, 2008 at 2:20 PM, Tobias Sing [EMAIL PROTECTED] wrote: Dear all, Max, first of all, many thanks for providing the odfWeave package. My problem: Whenever I have multiple plots in one single chunk of my ODF file, only the last plot gets shown. The problem can be reproduced with this toy example (to be used in an ODF file together with odfWeave -- I'm using the newest version 0.7.3): plot1, echo=FALSE, fig=TRUE= for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } @ -- Sarah Goslee http://www.functionaldiversity.org __ 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.
Re: [R] odfWeave: in multi-page plots only last page appears in document
Sarah, thanks for your reply. On Mon, Apr 14, 2008 at 8:32 PM, Sarah Goslee [EMAIL PROTECTED] wrote: If you ran that code outside ODFWeave, you'd only get one plot, so why would you expect to get more within ODFWeave? No, it depends on the device that is used. If I use PDF or postscript they all go into different pages of a single file. This is why I was referring to setImageDefs as a guess for a solution in my original post, but couldn't get it to work. Your suggestion of par/layout is unfortunately not what I'm looking for. I was hoping that the individual plots would come one after the other in the ODF document. And I also hope that 'pedestrian' solution of breaking into separate chunks in the ODF file has an alternative, because often this would required a rewrite of functions. Any other hints? Thanks, Tobias for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } You need to add some sort of par() command, or use layout(), to create a single plot that contains all three of the plots created by the loop. par(mfrow=c(2,2)) for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } for example. Or, if you want ODFWeave to handle placement, then you need to break that into three separate plots. Sarah On Mon, Apr 14, 2008 at 2:20 PM, Tobias Sing [EMAIL PROTECTED] wrote: Dear all, Max, first of all, many thanks for providing the odfWeave package. My problem: Whenever I have multiple plots in one single chunk of my ODF file, only the last plot gets shown. The problem can be reproduced with this toy example (to be used in an ODF file together with odfWeave -- I'm using the newest version 0.7.3): plot1, echo=FALSE, fig=TRUE= for (i in 1:3) { plot(1,1, main=paste('Plot',i)) } @ -- Sarah Goslee http://www.functionaldiversity.org __ 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.