Skip to content
Prev 44628 / 398513 Next

R: Including R plots in a Microsoft Word document

Perhaps some additional explanation is in order.  There are 
two basic classes of format:

- vector graphics such as windows metafile (wmf) and svg where 
the actual structure of the drawing is stored.    Editing these 
can be done with no loss of resolution and you can access  
the individual components of the plot, the titles, the points, 
etc. directly.

- bitmapped (also called raster) graphics such as jpg and png
where the drawing is stored as a sequence of pixels.  You can't
access the individual objects in a plot with raster graphics since
the image is just a set of pixels.  Resizing involves a loss of
resolution.

Windows metafiles are the preferred format for Word.  They
are vector graphics, not raster, and they can be edited from
within Word directly -- you don't need another editing program.
This should be much easier than using bmp or jpg together with
Photoshop.

You can either generate wmf files by right clicking the plot and
copying to the clipboard or using R code like this:

win.metafile("/myfile.wmf")
plot(1:10)
dev.off()

followed by   Insert | Picture | File   in Word.

In Paul's case he is generating his images in Linux, where I gather
Windows metafiles are not available, but in your case everything
is on Windows so you should not have that problem.

---
Date:   Sat, 21 Feb 2004 00:38:37 +0200 
From:   Mahmoud K. Okasha <m.okasha at palnet.com>
[ Add to Address Book | Block Address | Report as Spam ] 
To:   Paul Johnson <pauljohn at ku.edu>, <r-help at stat.math.ethz.ch> 
Subject:   Re: [R] R: Including R plots in a Microsoft Word document 

 
Hello,

I first would like to thank all of you for your great ideas. However, I
agree with Paul particularly in that the answer is more complicated than
other people make it seem when you have many graphs. I am trying all the
ideas. It seems that all of them work but with some difficulties. I have
Windows 2000 and MS Office 200. It seems to me that the easiest way of
solving the problem is through saving the file in Bmp or Jpeg format and
edit it in a graphic program such as Photoshop then insert it in the file. I
will continue trying all methods to find the easiest.

Best regards
Mahmoud


----- Original Message -----
From: "Paul Johnson" <pauljohn at ku.edu>
To: <r-help at stat.math.ethz.ch>
Sent: Friday, February 20, 2004 9:47 PM
Subject: Re: [R] R: Including R plots in a Microsoft Word document
plots but I'm having some trouble with including some of them in a Microsoft
Word document. Can any one tell me the easiest method of having copies of
the R-graphs in the Word documents?
Encapsulated
thousands of
--
Picasso
http://www.R-project.org/posting-guide.html
http://www.R-project.org/posting-guide.html