具有良好分辨率的绘图用于打印和屏幕显示 [英] Plots with good resolution for printing and screen display

查看:18
本文介绍了具有良好分辨率的绘图用于打印和屏幕显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

dev.new(width=5.8, height=3) 
par(mfrow=c(1,3),mar=c(1,1,2,1),oma=c(4,1,2,0),mgp=c(3, 0.5, 0)) 
plot(...)

并将它们复制并粘贴到 Microsoft Word 中.它们在 Word 中看起来非常好(我尝试了不同的宽度,直到找到一种效果很好的宽度)但是当我打印它们时,它们看起来很糟糕.经过一些网络搜索,我发现打印分辨率至少应为 300ppi.因此,在永远摆弄宽度和高度之后,我得出了使绘图看起来相同大小但分辨率更高的代码:

and coping and pasting them into Microsoft Word. They look really good in Word (I tried different widths until I found one that worked well) but when I printed them they looked terrible. After some web searching I found the resolution for printing should be at least 300ppi. So after fiddling with widths and heights for an eternity I came out with code that makes the plots look the same size but with a better resolution:

png(file="mag_feb.png",width=1800,height=950,res=300)

它们现在在打印时看起来不错,但在 Word(在屏幕上)中看起来一点也不清晰.会不会是尺寸的问题?没有办法让图表在印刷和屏幕上看起来都很好吗?我已经花了几个小时来解决这个问题,想不出还有什么可以尝试的,所以非常感谢任何帮助!

They now look good when printed, but they don't look sharp at all in Word (on screen). Could it be a problem with size? Isn't there a way to make graphs that look good printed and on screen? I already spent hours with this and can't think of anything else to try, so any help will be very much appreciated!

谢谢!

推荐答案

您的原始 png 命令中有一个小错误.试试这个:

There is a small error in your original png command. Try this:

png(file="mag_feb.png", units="in", width=11, height=8.5, res=300)

现在,宽度和高度以英寸为单位,而 res 以像素/英寸为单位.之前,res 参数被忽略.

Now, width and height are in inches, and res is in pixels/inch. Before, the res parameter was being ignored.

这篇关于具有良好分辨率的绘图用于打印和屏幕显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆