Erling Johan Frøysa
2013-Jun-02 17:15 UTC
[R] Strange behaviour of R graphics copied to PowerPoint
Hello, I am using R to create graphics, especially to plot time series charts. These charts are then copied as metafiles (for best quality) to a PowerPoint presentation and then saved to PDF (via the "Save As" dialog"). Attached is two pictures. The first picture shows how my chart looks like in the R Graphics window, and the second picture shows how the chart becomes after saving it to PDF. < http://r.789695.n4.nabble.com/file/n4668522/R.png> < http://r.789695.n4.nabble.com/file/n4668522/Rppt.png> As you can see. After saving the metafile to PDF via PowerPoint, some straight lines appears (it seems like all of the lines has the same origin in the upper left corner and ends somewhere on the times series line). This happens in both plot() and ggplot(). The problem appears more often when using daily data in my time series. With monthly data the problem don't exist. Have anyone experienced this before? Do you think the problem is related to R or to Powerpoint? Thanks all, E [[alternative HTML version deleted]]
Kevin Wright
2013-Jun-03 11:55 UTC
[R] Strange behaviour of R graphics copied to PowerPoint
I've had something similar and have had better luck using the PrimoPDF software to "Print" a PowerPoint to a PDF device instead of saving from PowerPoint to PDF. Best, Kevin On Sun, Jun 2, 2013 at 12:15 PM, Erling Johan Frøysa < erling.froysa@gmail.com> wrote:> Hello, > > I am using R to create graphics, especially to plot time series charts. > These charts are then copied as metafiles (for best quality) to a > PowerPoint > presentation and then saved to PDF (via the "Save As" dialog"). > > Attached is two pictures. The first picture shows how my chart looks like > in > the R Graphics window, and the second picture shows how the chart becomes > after saving it to PDF. > > < http://r.789695.n4.nabble.com/file/n4668522/R.png> > > < http://r.789695.n4.nabble.com/file/n4668522/Rppt.png> > > As you can see. After saving the metafile to PDF via PowerPoint, some > straight lines appears (it seems like all of the lines has the same origin > in the upper left corner and ends somewhere on the times series line). This > happens in both plot() and ggplot(). The problem appears more often when > using daily data in my time series. With monthly data the problem don't > exist. > > Have anyone experienced this before? Do you think the problem is related to > R or to Powerpoint? > > Thanks all, > > E > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >-- Kevin Wright [[alternative HTML version deleted]]
Jeff Newmiller
2013-Jun-03 11:58 UTC
[R] Strange behaviour of R graphics copied to PowerPoint
I have not seen this particular problem, but I have seen other problems and I tend to export bitmaps or pdf files as a result. Note that a reproducible example is usually required to to obtain help on this list, and posting in HTML format is bad because it mutilates example code, so fix your email client. Please read the Posting Guide for more etiquette tips. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. "Erling Johan Fr?ysa" <erling.froysa at gmail.com> wrote:>Hello, > >I am using R to create graphics, especially to plot time series charts. >These charts are then copied as metafiles (for best quality) to a >PowerPoint >presentation and then saved to PDF (via the "Save As" dialog"). > >Attached is two pictures. The first picture shows how my chart looks >like in >the R Graphics window, and the second picture shows how the chart >becomes >after saving it to PDF. > >< http://r.789695.n4.nabble.com/file/n4668522/R.png> > >< http://r.789695.n4.nabble.com/file/n4668522/Rppt.png> > >As you can see. After saving the metafile to PDF via PowerPoint, some >straight lines appears (it seems like all of the lines has the same >origin >in the upper left corner and ends somewhere on the times series line). >This >happens in both plot() and ggplot(). The problem appears more often >when >using daily data in my time series. With monthly data the problem don't >exist. > >Have anyone experienced this before? Do you think the problem is >related to >R or to Powerpoint? > >Thanks all, > >E > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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.
Duncan Murdoch
2013-Jun-03 16:46 UTC
[R] Strange behaviour of R graphics copied to PowerPoint
On 02/06/2013 1:15 PM, Erling Johan Fr?ysa wrote:> Hello, > > I am using R to create graphics, especially to plot time series charts. > These charts are then copied as metafiles (for best quality) to a PowerPoint > presentation and then saved to PDF (via the "Save As" dialog"). > > Attached is two pictures. The first picture shows how my chart looks like in > the R Graphics window, and the second picture shows how the chart becomes > after saving it to PDF. > > < http://r.789695.n4.nabble.com/file/n4668522/R.png> > > < http://r.789695.n4.nabble.com/file/n4668522/Rppt.png> > > As you can see. After saving the metafile to PDF via PowerPoint, some > straight lines appears (it seems like all of the lines has the same origin > in the upper left corner and ends somewhere on the times series line). This > happens in both plot() and ggplot(). The problem appears more often when > using daily data in my time series. With monthly data the problem don't > exist. > > Have anyone experienced this before? Do you think the problem is related to > R or to Powerpoint?This has come up before, and it does appear to be a problem in Powerpoint: it doesn't export to PDF very well. It is possible that the metafiles that R produces could be changed so as not to trigger this bug, but that would really need input from Microsoft on what changes are needed, and as far as I've heard, they've never made any comment or acknowledgment of the problem. My advice would be to contact them; if they're unresponsive, try some other software (OpenOffice, LibreOffice, LaTeX+Beamer, ...). Duncan Murdoch
Steve Simon, P.Mean Consulting
2013-Jun-03 17:37 UTC
[R] Strange behaviour of R graphics copied to PowerPoint
As I understand it, there are multiple competing standards for the Windows Metafile (WMF) format. See --> http://en.wikipedia.org/wiki/Windows_Metafile I like WMF because it is vector based and thus scales nicely. But eventually I gave up on it because the WMF format was unpredictable when exported to other applications. I would encourage you to experiment with the bmp() and png() functions. If you specify a large enough value for width and height so that the don't get re-scaled, then they will look just as good as the WMF format. If you like to tinker with a graph onscreen and then save it, you need to open the graphics window at the "right" size so that the saved BMP or PNG file does not need rescaling in Powerpoint. I hope this makes sense. Graphics are tricky in any package. Steve Simon, www.pmean.com -- View this message in context: http://r.789695.n4.nabble.com/Strange-behaviour-of-R-graphics-copied-to-PowerPoint-tp4668535p4668586.html Sent from the R help mailing list archive at Nabble.com.