问题
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