用R画图的时候出了这错,之前用par()画都没出问题,提示的意思是我们画布的边缘太宽了,查了一下R官网给的:
help("par")
不断往下拉就能看到mar
mar
A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot. The default is c(5, 4, 4, 2) + 0.1.
我运行试一下:
par("mar")
![]()
既然提示大了我们输入设置一下:
par(mar=c(1,1,1,1))
解决
本文介绍了解决在R中绘图时遇到的边缘过宽问题的方法。通过调整par参数中的mar值,可以有效控制绘图区域的边缘大小,避免因边缘过宽而导致的图表显示不全的问题。
2万+

被折叠的 条评论
为什么被折叠?



