R making space for the xaxis labels

ⅰ亾dé卋堺 提交于 2019-12-31 05:41:10

问题


I have the following boxplots

as you can see my problem is that the lables are not fitting in my figure since they are exceeding the margins of the figure, I tried to use the par function and its mars attribute that shows the margins, but didn't work for me, I used par(par()$mar+c(10,0,0,0))

If you got any idea for my problem please let me know


回答1:


You don't appear to have assigned your newly created mar parameter to the mar parameter

Compare

d <- data.frame(a=1:5,b=1:5)
boxplot(d)

# your call was
# par(par()$mar+c(10,0,0,0)) which doesn't specify which 
# par is being set (and returns NULL, (A vague hint that it isn't working properly)
par(mar = par('mar') + c(10,0,0,0))
boxplot(d)


来源:https://stackoverflow.com/questions/15558826/r-making-space-for-the-xaxis-labels

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!