[R] .eps files and powerpoint

Marc Schwartz marc_schwartz at me.com
Wed Jul 24 17:36:45 CEST 2013


Rich,

You are missing some options in the call to postscript() below. It needs to be:

  postscript(file = "file.eps", width = x, height = y,
             horizontal = FALSE, onefile = FALSE, paper = "special")

The first line needs to have values for 'x' and 'y' for the width and height of the image, as they default to 0.

The second line of 3 options are all critical to producing an EPS file, as opposed to a PS file. This is described in the 4th paragraph of the Details section of ?postscript.

If you import that file into any of the MS Office products (typically also for OpenOffce, LibreOffice, etc.), a PNG preview image will be created during import. It is the PNG bitmapped image that you can see when displaying the EPS file in the document, hence the degradation in quality. Some years ago, all you would see is a rectangular box with an "X" across it, as a placeholder for the imported image. 

Only if you then print the Office file using a Postscript printer driver, will you see the actual vector based EPS image. The target of that printing operation could be a printer for hard copy, a PS or a PDF file. MS Office does not support the rendering of the EPS image directly.

If you are operating on Windows, as opposed to Linux or OSX, typically EMF/WMF files are the easiest way to go in terms of sticking R plots into an Office file, as they are also vector based images, but are effectively Windows only.

Regards,

Marc Schwartz


On Jul 24, 2013, at 10:20 AM, Richard M. Heiberger <rmh at temple.edu> wrote:

> png("png300.png", res=300, width=2880, height=1440)
> 
> gives good behavior.  Thank you.  This will become my standard for export
> to powerpoint.
> 
> postscript(file='file.eps', onefile=FALSE)
> produces eps files that powerpoint rejects, even though ghostview is
> satisfied.
> 
> Rich
> 
> 
> On Wed, Jul 24, 2013 at 2:07 AM, Patrick Connolly <
> p_connolly at slingshot.co.nz> wrote:
> 
>> On Tue, 23-Jul-2013 at 10:23PM -0400, Richard M. Heiberger wrote:
>> 
>> |> I have colleagues who use powerpoint.  When I send my colleagues pdf
>> files
>> |> or ps files, powerpoint
>> |> rejects them.  Powerpoint does accept some eps files.
>> |>
>> 
>> [...]
>> 
>> |> Does anyone know a workaround that will get vector graphics from R into
>> |> powerpoint?
>> |> win.metafile is not acceptable.  The resolution of emf files from R is
>> |> worse than png files.
>> 
>> Maybe worse than png files at the default resolution which is 72 dpi.
>> Change that to something like 300 and nobody will see a jagged edge in
>> a PowerPoint slide.
>> 
>> HTH
>> 
>> 
>> |>
>> |> Thanks
>> |> Rich



More information about the R-help mailing list