Producing a vector graphics image (i.e. metafile) in R suitable for printing in Word 2007

前端 未结 6 1304
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 23:04

First a caveat: I posted this question here on SuperUser, but it is clearly the wrong place to ask R questions. I recognize that it is not directly a programming question,

6条回答
  •  余生分开走
    2020-11-30 23:29

    Your only option is to use high resolution raster graphics. Once you're over 300 dpi it will be completely indistinguishable from vector printed; it will just make larger files.. Your copy and paste method is coming in at 72 dpi and will look terrible. If you import from a file you can get the resolution in the file and things will be much better. Fortunately Office 2007 is supposed to handle png images, which have the best compression for typical graphs. Let's say you wanted the image 4" wide and 6" high...

    png('printsGreat.png', width = 4, height = 6, units = 'in', res = 300)
    plot(c(1:100), c(1:100), pch=20)
    dev.off()
    

    Also, Office 2007 is supposed to be able to handle EPS files and R postscript files are by default EPS compatible when you print one page.

    postscript("printsPerfectly.eps", width = 4, height = 6, horizontal = FALSE, onefile = FALSE)
    plot(c(1:100), c(1:100), pch=20)
    dev.off()
    

    But if you don't have luck with them go back to the high resolution image.

提交回复
热议问题