[R] help for high-quality plot again

Duncan Mackay mackay at northnet.com.au
Tue Sep 18 09:54:52 CEST 2007


I now rarely use Word; if the size of the wmf as fixed by the win.metafile 
is smaller
than the size of the page within the margins you should have no problem.

So for letter size 8.5 x 11 inches with 1 inch margins and allowing 0.5 in 
for a label
you coud have a landscape mode wmf size of height = 6 and width = 9

If you wanted a larger size you would have to use the format picture and 
?frame to
set the picture in Word

For pointsize see
? windows
or
?ps.options

Most/?all graphic devices have this argument.

It relates to the size of the font you are using.
I changed the pointsize as an example - you can use the default font size 
if it suits your graph.

Sometimes it is easier to change pointsize than other things.

Duncan

At 16:13 18/09/07, you wrote:
>Thank you very much, Sir. Basically, I think the value of width and height 
>will be determined by top and left side rules in word, right? but how to 
>determine pointsize? And when you wrote filename='x.emf', where can I find 
>x.emf, can I specify the path under filename? I appreciate.
>
>
>Zheng Lu
>
>Quoting Duncan Mackay <mackay at northnet.com.au>:
>
>>I have found through experience to use win.metafile produce a .wmf file 
>>and in word insert the picture as a file.
>>
>>The trick is to do produce everything as it will appear in the word document.
>>Size is critical.
>>The width and height of the wmf file must be as it will appear in word eg
>>
>>win.metafile(filename = "x.wmf", width = 5, height = 3, pointsize = 10, 
>>restoreConsole = TRUE)
>>
>>Regards
>>
>>Duncan Mackay
>>Department of Agronomy and Soil Science
>>University of New England
>>ARMIDALE NSW 2351
>>Email:
>>Work:  dmackay9 at pobox.une.edu.au
>>Home: mackay at northnet.com.au
>>
>>
>>At 14:03 18/09/07, you wrote:
>>>Dear all:
>>>
>>>Thank you very much for your help. Actually, I save the
>>>plot(mfrow=c(2,3))as metafile, however, when I insert picture from the
>>>file in word to import this plot picture, everything seems to be
>>>shrinked. Is there anyone having good experience with import graph from
>>>R to Word document? Do we have export.graph function in R? Thanks.
>>>
>>>
>>>ZLU
>>>
>>>Quoting Gabor Grothendieck <ggrothendieck at gmail.com>:
>>>
>>> > Use windows metafile format.  Its a vector graphic format so it will
>>> > display in full
>>> > resolution.  png is bitmapped and so won't.  Also you can edit a wmf
>>> > graphic in Word using Word's built in graphic editor so you could change
>>> > the labels, etc. even after you have imported it.  Right click the 
>>> graphic
>>> > in R and save or copy it as a metafile.
>>> >
>>> > On 9/16/07, Zheng Lu <zlu at umich.edu> wrote:
>>> >> Dear all:
>>> >>
>>> >> I am curious how to generate high-quality plot and graph with R and
>>> >> input it into my word document. my plot was always generated in device
>>> >> 2, when I save it as PNG, the quality is poor. Thank you very much for
>>> >> your consideration and time.
>>> >>
>>> >>
>>> >> ZLu
>>> >>
>>> >> ______________________________________________
>>> >> R-help at r-project.org mailing list
>>> >> https://stat.ethz.ch/mailman/listinfo/r-help
>>> >> PLEASE do read the posting guide 
>>> http://www.R-project.org/posting-guide.html
>>> >> and provide commented, minimal, self-contained, reproducible code.
>>> >>
>>> >
>>> >
>>> >
>>>
>>>______________________________________________
>>>R-help at r-project.org mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>>and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>
>>
>
>



More information about the R-help mailing list