Distance between axis and x.lab

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Distance between axis and x.lab

Andrej Kastrin
Dear R useRs,

what's the most elegant way to modify distance between x-axis and it's
title. I didn't find any parameter to do that...

Thank's in advance,

cheers, Andrej

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Distance between axis and x.lab

Marc Schwartz (via MN)
On Tue, 2006-01-24 at 13:25 +0100, Andrej Kastrin wrote:
> Dear R useRs,
>
> what's the most elegant way to modify distance between x-axis and it's
> title. I didn't find any parameter to do that...
>
> Thank's in advance,
>
> cheers, Andrej

If you just want to move the x axis label and no other annotation, the
easiest way is probably:

 # Draw a plot, set the x axis label to ""
 plot(1:10, xlab = "")

 # Now use mtext() to do the label and move it
 # away from the axis by using 'line'
 mtext(side = 1, text = "Index", line = 4)


Compare the above to:

  plot(1:10)


Further flexibility is provided by the 'ann', 'axes', 'xaxt' and 'yaxt'
arguments to skip other components of the plot such as titles and axes.

See ?plot.default, ?title, ?axis, ?mtext and ?text for more information.

HTH,

Marc Schwartz

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html