Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 图尝试使用布局()时边距过大_R_Plot_Visualization - Fatal编程技术网

R 图尝试使用布局()时边距过大

R 图尝试使用布局()时边距过大,r,plot,visualization,R,Plot,Visualization,我有这个数据集 wine <-read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data",sep=",") attach(wine) winemlayout.show(布局(m)) >布局图(m) >绘图(V2[1:25]~V5[1:25]);带(葡萄酒、历史(V5)) plot.new()中出错:图形边距太大 我尝试使用png(“1.png”,800600),创建了文件,但它

我有这个数据集

wine <-read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data",sep=",")
attach(wine)
winemlayout.show(布局(m))
>布局图(m)
>绘图(V2[1:25]~V5[1:25]);带(葡萄酒、历史(V5))
plot.new()中出错:图形边距太大

我尝试使用
png(“1.png”,800600)
,创建了文件,但它告诉我我没有查看文件内容的权限。

增加设备的尺寸。这在我的系统上运行良好:

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

尝试增加设备的尺寸。我得到相同的结果。您只需在R Studio中手动调整绘图窗口。。。这就可以了。或者干脆减少与保证金相关的参数,比如
par(mar=c(3,3,1.5,0.4),mgp=c(1.5,0.4,0),tck=-0.05)
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