[R] Bad EMF export

Marc Schwartz marc_schwartz at comcast.net
Mon Oct 15 18:54:59 CEST 2007


On Mon, 2007-10-15 at 18:21 +0200, Poirier Clement wrote:
> > How are you doing this? Via code?
> 
> I just type saveCopy(file, type="emf", etc....) after the barplot()  
> function ; but using windows commands (file, save as) do the same.
> 
> > If so, more than likely you forgot to add:
> >
> >   dev.off()
> >
> > after the code that generates the plot.  If you don't close the device,
> > then parts of the plot are not "flushed" from the cache to the disk file
> > and you are left with an incomplete plot in the file.
> 
> Ok but where has the line dev.off() to be placed ? If after the  
> barplot() function, the plot disappears and there's nothing to save  
> anymore ?
> 
> Thank you !

I can't seem to locate anything on saveCopy() for some reason. I presume
that it is Windows specific, but I have searched the R Reference manual,
the list archives and the source code tree for more information.

We may need somebody with a Windows install to provide more guidance
here and to confirm my transient blindness.

Normally, the dev.off() line would follow a call to emf() where you are
going directly to the file and not to the display first. You would open
the emf() device, then your plotting code follows, finally ending with
dev.off().

You might want to review ?saveCopy to get a feel for any examples in the
help file and any Details that would point to potential gotchas in its
use.

Sorry that I can't be more specific.

Marc



More information about the R-help mailing list