Skip to content

Save image as metafile

4 messages · mentor_, David Winsemius, Brian Ripley

#
Hi,

how can I save an image as a metafile?
I know within windows you can do a right click and then 'save image as
metafile'
but I use Mac OS X...I know as well that mac users have a right click as
well, but
it does not work.
Is there a command in R for saving images as metafiles?

Regards,
mentor
#
On Dec 8, 2008, at 7:51 AM, mentor_ wrote:

            
Which means this question would be better posed on the Mac OS list.
Are you using the R.app? If so, then you need to focus on the quartz  
device window (by clicking on it or choosing it from the Window"  
pulldown menu)  and choose Save as.. from the File menu. It will not  
offer to save it as a windows metafile, but rather does so as a pdf.  
In Preview you can open the pdf and then save as other formats,  
although wmf is not one of the options. If you prefer a tiff file, you  
could use Grab. Even LemkeSoft's GraphicConverter does not offer a WMF  
option, so it's probably a proprietary format that M$ is not  
documenting well or trying to restrict in some manner. To find out  
what devices are available, try:

 > capabilities()
     jpeg      png     tiff    tcltk      X11     aqua http/ftp   
sockets   libxml     fifo   cledit    iconv      NLS
     TRUE     TRUE    FALSE     TRUE     TRUE     TRUE     TRUE      
TRUE     TRUE     TRUE     TRUE     TRUE     TRUE
  profmem    cairo
    FALSE     TRUE

So on my machine, a png device can get graphics output. That should  
provide all of the functionality of a wmf format and be much more  
cross-platform.
It would appear not, but why would it be necessary? What's wrong with  
the choice among jpeg, png, pdf or tiff?
#
On Mon, 8 Dec 2008, David Winsemius wrote:

            
It is basically a set of calls to the (proprietary) Windows GDI.  There 
seems to be no viable implementation on any other platform (except as a 
bitmap, but then there are lots of portable bitmap formats supported by R)
Not so: wmf is a primarily a vector format: however PDF is a good 
cross-platform substitute.

  
    
#
On Dec 8, 2008, at 4:02 PM, Prof Brian Ripley wrote:

            
Thank you for the correction.  I had conflated "lossless format" with  
"vector format".  Perhaps the OP will be happier with pdf output. Will  
he be able to use cmd-S to bring up a Save as dialog if he is not  
running from R.app?