为文字处理指定“另存为图像”尺寸

问题描述 投票:0回答:1

我创建了一个带有传单的热图,我想将其导出为具有以下尺寸的图像(.png):

  • 长度=17.5厘米
  • 宽度=5厘米

这张图片最终会被粘贴到word文档中。我知道可以选择调整纵横比,但不确定是否有替代解决方案。

r r-leaflet
1个回答
1
投票
# Creating a plot
x=rnorm(20)
plot(x)

# saving plot
png(file="saving_plot1.png",
    width=5, height=17.5, units="in", res=100)
hist(x, col="Black")
dev.off()
© www.soinside.com 2019 - 2024. All rights reserved.