如何在基础 R 中更改绘图的分辨率?

r programmingserver side programmingprogramming更新于 2025/4/11 14:37:17

在基础 R 中,我们可以将绘图保存为 png 并在同一阶段传递分辨率。执行此操作的过程是使用 res 参数创建具有分辨率的 png 图像,然后创建绘图并使用 dev.off() 创建文件。查看below examples to understand how it works.

示例1

> png(file="example1.png",res=100)
> plot(1:10)
> dev.off()

输出:

示例2

> png(file="example2.png",res=200)
> plot(1:10)
> dev.off()

输出


相关文章