【发布时间】:2015-05-24 10:01:57
【问题描述】:
我想如下保存我的直方图。当我运行以下命令时,该图会显示在 Rstudio 中:
hist_L4 <- hist(L_4,breaks=10,main='histo')
print(hist_L4)
当我尝试像这样保存它时,它只会保存空白的白色图像,这与它在 Rstudio 中打印的图不同。
hist_L4 <- hist(L_4,breaks=10,main='histo')
png(file=paste0('path/name_of_png' , '.png' ))
print(hist_L4)
dev.off()
为什么我得到空白的白色地块?谢谢。
【问题讨论】:
-
为什么不直接通过
hist调用。或者使用plot(hist_L4) -
顺便说一句,你确定
print(hist_L4)生成了一个情节,还是之前的hist_L4 <- hist(...调用打印了情节?