生成与RStudio图形窗口具有相同尺寸/分辨率的图形图像

时间:2016-05-26 21:09:00

标签: r graph rstudio

我正在尝试输出与RStudio中的图形窗口具有相同分辨率的图形图像,并且我一直在失败。这是我正在使用的代码:

# Leading edge arrival times
#tiff(file = "LEAT.tiff", width = 6400, height = 3200, units = "px", res = 400)
#Cairo(file="LEAT.png", type="png", units="in", width=4, height=3, pointsize=12, dpi=20)
#jpeg("LEAT.jpeg", width = 4, height = 3, units = 'in', res = 1200)
#tiff("LEAT.tiff", width = 4, height = 3, units = 'in', res = 600)
LEAT <- hist(data)
plot(LEAT, 
     col= "darkblue", 
     xlim=c(0,30), 
     main="Leading Edge Arrival Times", 
     xlab="Hours", 
     ylab="Frequency")  
mtext("(Using predicted 90th percentile streamflow)", side=3)
#dev.off()

如果我只是从RStudio窗口导出(尺寸根据我的窗口大小设置),这是图像:

enter image description here

这是使用jpeg函数的图像: (#jpeg("LEAT.jpeg", width = 4, height = 3, units = 'in', res = 1200)

enter image description here

如何设置这些图形导入/创建功能中的任何一个以生成类似的图形?

1 个答案:

答案 0 :(得分:0)

这似乎有效,但男人花了很多试验和错误:

 IntStream.range(0, request.getOranges().size())
    .mapToObj(i -> Converter.fromOranges(request.getOranges().get(i), i))
    .collect(toList())

图像:

enter image description here

相关问题