更改位图的分辨率
我正在用 R 制作一些图表,并将它们复制到 Word 中。我将它们作为图元文件来处理,但 Word 似乎无法处理它们。 R 中复制图形的另一个选项是位图,但是当我使用它时,Word 中图形的质量很糟糕。
我在这个网站上看到了一些关于更改分辨率的答案,但前提是我保存了我想避免的图表。有没有办法改变复制图形的分辨率?
谢谢,
sbg
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当图表显示在屏幕上时,它们是根据屏幕分辨率(即 72dpi)绘制的。对于打印,您需要使用至少 300dpi,或切换到矢量格式。 Word可以导入Windows图元文件(
.wmf
)格式的图形;但您的另一个选择是使用例如“这会保存到磁盘”来保存绘图,您说您想避免这种情况,但您可以稍后再次删除它(甚至以编程方式,使用
file.remove
) 。我还想说明的是,当您复制和粘贴时,您的工作并不像使用代码时那么容易重现。您所做的事情没有任何踪迹,当您的数据发生更改时,您需要再次执行单击的繁琐操作,而不仅仅是执行更新的脚本。
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.,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.