【问题标题】:Controlling DPI of plot in R在 R 中控制绘图的 DPI
【发布时间】:2020-09-14 11:19:16
【问题描述】:

需要在 R 中制作一个绘图,我必须控制要生成的图形的 DPI 大小。我必须使用 TIF 格式的 EPS。我不知道如何在 R 中控制它。非常感谢任何帮助。我已经创建了一些示例代码。

x = seq(1,10,0.1)
y = seq(1,10,0.1)

plot(x,y, type = "l", lwd = 2, col = "orange", xlab = "X-label", ylab = "Y-Label")

-谢谢

【问题讨论】:

    标签: r plot tiff dpi


    【解决方案1】:

    您可以使用以下代码以 tiff 格式保存高分辨率绘图

    x = seq(1,10,0.1)
    y = seq(1,10,0.1)
        
    tiff("test.tiff", units="in", width=5, height=5, res=300)
    plot(x,y, type = "l", lwd = 2, col = "orange", xlab = "X-label", ylab = "Y-Label")              
    dev.off()
    

    这里,res 相当于 DPI。您可以使用以英寸为单位的图像的widthheight

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-31
      • 2015-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多