Marc,

very interesting.

Your example works on Windows.  This example doesn't work on windows

> postscript(file = "file2.eps", height = 4, width = 4,
+                 horizontal = FALSE, onefile = FALSE, paper = "special")
> barchart(1:3)
> dev.off()

Several examples, including the real one I was having trouble with
previously, work on
PowerPoint on Mac.  They don't work on PowerPoint in Windows.

More: I put some eps figures into PP on Mac (where they work) and then
saved the file and
opened it in PP on Windows.  They don't work on Windows.

Since Windows PP users are the target audience at the moment, I will stay
with the res=300 png file.

This is consistent with my other experiences with PP and Word for Mac,
compared to PP and
Word for Windows.  The two MS sets of programs are highly correlated, but
far from identical.

When people send my PP or Word files, I am more likely to open them first
on the Mac side of my
machine.  The graphs have spurious lines (connecting the end of the red
line to the beginning of
the green line, for example, when the two lines should be distinct).
 Alignment is different
(two-line titles will get folded at the wrong place).  I need to move back
to the Windows side in
the VM to see the files as the author intended.

Rich


On Wed, Jul 24, 2013 at 12:16 PM, Marc Schwartz <marc_schwartz@me.com>wrote:

> Hi Rich,
>
> Seems to work for me using Powerpoint in MS Office 2011 for Mac.
>
> I used the following code:
>
> postscript(file = "file.eps", height = 4, width = 4,
>                 horizontal = FALSE, onefile = FALSE, paper = "special")
>
> plot(rnorm(20))
>
> dev.off()
>
>
>
> Then I used the insert picture from file function in Powerpoint. It
> created the PNG preview during import and I can see that on the slide in
> the application without issue.
>
> I put the EPS file and the PPTX file up on DropBox if you want to look at
> them:
>
> EPS File: https://www.dropbox.com/s/d8avze4yv51blso/file.eps
>
> PPTX file: https://www.dropbox.com/s/pm7oejm0g6rc0a5/RPlot.pptx
>
>
> Regards,
>
> Marc
>
>
>
> On Jul 24, 2013, at 10:49 AM, "Richard M. Heiberger" <rmh@temple.edu>
> wrote:
>
> Thanks Marc,
>
> the extra arguments to postscript still don't produce something that
> PowerPoint will accept.
> With your call, PP still displayed only the icon.  PP did not generate its
> own png file.
>
> Since my immediate goal is the projection screen for a PowerPoint
> presentation, I will go
> directly to the png file.  For the proceedings and for paper I will
> continue to use the pdf file.
>
> Rich
>
> On Wed, Jul 24, 2013 at 11:36 AM, Marc Schwartz <marc_schwartz@me.com>wrote:
>
>> 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@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@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
>>
>>
>
>

	[[alternative HTML version deleted]]

