Philip Rhoades
2011-Sep-25 10:54 UTC
[R] Increase space between xlab and X axis tick labels
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? Thanks, Phil. -- Philip Rhoades GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil at pricom.com.au
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
Gabor Grothendieck
2011-Sep-25 16:24 UTC
[R] Increase space between xlab and X axis tick labels
On Sun, Sep 25, 2011 at 6:54 AM, Philip Rhoades <phil at pricom.com.au> 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? >Try adjusting mar and mgp: opar <- par(mar = c(5, 6, 4, 2) + 0.1, no.readonly = TRUE) plot(0, las = 2, mgp = c(4, 1, 0), ylab = "Y") par(opar) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com