尝试使用 layout() 时图形边距太大

Figure margins too large when trying to use layout()

我有这个数据集

wine <-read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data",sep=",")
attach(wine)

并且我想使用布局功能来提示六个散点图,每个散点图的直方图都在上面,但是当尝试将第一个散点图和它自己的直方图放在上面时,出现此错误:

> m<-rbind(c(2,4,6),c(1,3,5),c(8,10,12),c(7,9,11))
> layout.show(layout(m))
> layout(m)
> plot(V2[1:25]~V5[1:25]);with(wine, hist(V5))
Error in plot.new() : figure margins too large

我尝试使用 png("1.png",800,600),文件已创建,但它告诉我我没有查看文件内容的权限。

增加设备的尺寸。这在我的系统上工作得很好:

png("test.png", width = 1000, height = 1000)

layout(m)
plot(V2 ~ V5, data = wine[1:25,])
with(wine, hist(V5))

dev.off() #you need to close the device to open the file in other software