开发者

Changing resolution of bitmaps

I am making some graphs with R and I am coping them to Word. I was coping them as metafiles but Word doesn't seem to be able to cope with them. The other option in R to copy graphs is a bitmap, but when I use this the quality of the graphs in word is terrible.

I saw some answers about changing the resolution in开发者_高级运维 this website but only if I saved the graphs which I would like to avoid. Is there a way of changing the resolution for copied graphs?

Thanks,

sbg


When the graphs are onscreen, they are drawn for a screen resolution (i.e. 72dpi). For print, you need to use at least 300dpi, or switch to a vector format. Word can import graphs in Windows Metafile (.wmf) format; but your other option is to save the plot using, e.g.,

png("my plot.png", res = 300)
plot(1:5)
dev.off()

This saves to disk, which you said you wanted to avoid, but you can always delete it again later (programatically even, with file.remove).

I'd also like to make the case that when you copy and paste, your work isn't as easily reproducible as when you use code. There is no trace of what you have done, and when your data changes, you need to go through the rigmarole of clicking again, rather than just executing your updated script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜