[R] Polygons in Windows metafile

Peter Ehlers ehlers at ucalgary.ca
Wed Jan 27 09:40:41 CET 2010


Steve Taylor wrote:
> Hi all,
>  
> I'm producing some pie charts (Yes I know!) and plotting them into a Windows metafile.  This is for insertion into a Word document.
>  
> The circles come out rather jagged when you zoom in on them, the cause of which I have perhaps narrowed down to the way polygon() works in the metafile device.  The polygon coordinates seem to be quantised to the pixels, which is odd for a vector graphics format.
>  
> Try this to see what I mean:
>  
> win.metafile('test.emf')
> par(mfrow=c(2,2))
> for(i in 1:4) pie(sample(5,4,repl=TRUE))
> dev.off()
>  
> Is there a way to get a better quality EMF file of this output?  PDF output looks great, but Word doesn't seem to understand inserting a PDF graphics file.  Word also did something strange with EPS output.

You should be able to insert the PDF version into Word
with 'Insert Object'. I don't know if it'll improve the
look. Does setting pie(..., edges=1000) help?

  -Peter Ehlers

>  
> cheers,
>     Steve
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.
> 
> 

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list