[R] Increase space between xlab and X axis tick labels

Jim Lemon jim at bitwrit.com.au
Sun Sep 25 13:07:29 CEST 2011


On 09/25/2011 08:54 PM, Philip Rhoades wrote:
> People,
>
> I am using the "las=2" parameter to rotate the labels for the X axis
> ticks but it means that they are almost touching the "xlab" string. I
> have been messing around with the "mai" paremeter but that doesn't help
> - is there some way of increasing the space between xlab and the X axis
> tick labels?
>
Hi Phil,
Have a look at the "hadj" argument in the "axis" function. Perhaps 
setting this to 1 will set the labels in the correct position. If not, 
you might have to go to:

# allow display outside the plot region
par(xpd=TRUE)
# plot the labels using the text function
text(...)
# restore plot region clipping
par(xpd=FALSE)

Jim



More information about the R-help mailing list