Michael J. Manning
2003-Jun-17 05:34 UTC
[R] Quality of graphics produced as windows metafiles
Hi all My details: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 7.0 year 2003 month 04 day 16 language R Please excuse my woeful ignorance, but when I copy the contents of an R-graphics window produced using "windows()" (or any of its close relations) to the clipboard as a windows metafile and then paste the contents into another document, typically an MS Word file, the quality of the graphics produced seems to vary considerably. I can produce sharp looking results if the R-graphics window contains a single graph only; however, if I partition the graphics window using "par(mfrow=c(x,y))" or similar and draw multiple graphs, then the quality of the results produced by the copy and paste declines as x and y increase, with curves becoming increasingly pixelated etc. On screen, as the number of graphs on the device increases, the quality of the graphics on screen declines, I guess, as the device has to more graphics with less available pixels per graph. Hence, if the content copied to the clipboard is just a snapshot of what's on screen, then I can understand the drop in quality when I paste the contents of the clipboard where I want them ("garbage in=garbage out" principle...). However, if I create a windows metafile directly with "win.metafile(file=....)", draw multiple graphs, and close the device the results seem to be no better, i.e. curves pixelated etc. E.g. win.metafile(file="test.wmf",pointsize=8,height=8.5,width=5.75) par(mfrow=c(5,2)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) plot(density(rnorm(1000)) dev.off() I note that the help page for "windows()" states that the number of pixels per inch can be specified and passed to the "windows()" device (and hence on to "win.metafile()" and "win.graph()") via the "xpinch" and ypinch" arguments. I have tried adjusting these without much succes, e.g. windows(rescale="fit",xpinch=102,ypinch=77)#<-- xpinch and ypinch values from post to R-help, 11 Sept 2001 .... windows(rescale="fit",xpinch=204,ypinch=154) .... All suggestions gratefully appreciated. Cheers MJM -- Michael J. Manning National Institute of Water and Atmospheric Research Ltd (NIWA) Private Bag 14901, Kilbirnie, Wellington, New Zealand Tel +64 4 386 0851 Fax +64 4 386 0574