Hi, How can I make the distance between an axis-label and the axis bigger? I haven't found anything in par()...
Hi J?rg,>> I haven't found anything in par()...No? Well don't bet your bottom $ on it (almost never in R). ?par (sub mgp). Mark. J?rg Gro? wrote:> > Hi, > > How can I make the distance between an axis-label and the axis bigger? > > I haven't found anything in par()... > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: http://www.nabble.com/defining-the-distance-between-axis-label-and-axis-tp18858861p18858935.html Sent from the R help mailing list archive at Nabble.com.
Prof Brian Ripley
2008-Aug-06 20:33 UTC
[R] defining the distance between axis label and axis
On Wed, 6 Aug 2008, J?rg Gro? wrote:> How can I make the distance between an axis-label and the axis bigger? > I haven't found anything in par()...Look at "mgp". Depending what you mean by 'axis-label' one of its three values is relevant. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Charles C. Berry
2008-Aug-06 20:35 UTC
[R] defining the distance between axis label and axis
On Wed, 6 Aug 2008, J?rg Gro? wrote:> Hi, > > How can I make the distance between an axis-label and the axis bigger? > > I haven't found anything in par()...Keep reading... par package:graphics R Documentation Set or Query Graphical Parameters [...] 'mgp' The margin line (in 'mex' units) for the axis title, axis labels and axis line. The default is 'c(3, 1, 0)'. [...] Chuck> > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >Charles C. Berry (858) 534-2098 Dept of Family/Preventive Medicine E mailto:cberry at tajo.ucsd.edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901
on 08/06/2008 03:21 PM J?rg Gro? wrote:> Hi, > > How can I make the distance between an axis-label and the axis bigger? > > I haven't found anything in par()...Depends upon what you mean by the axis labels... If by axis labels, you are referring to the text annotation typically centered on the axis (eg. below the x axis or to the left of the y axis), you will likely want to set 'ann = FALSE' in the plot call and then use mtext() to place the text. Example: plot(1:10, ann = FALSE) mtext(side = 1, text = "X Axis", line = 3) mtext(side = 2, text = "Y Axis", line = 3) See ?plot.default and ?mtext for more information. If on the other hand, you are talking about the placement of the text placed at each tick mark on the axis, look again at ?par and take note of 'mgp', specifically, the middle value of the vector. For example, compare: plot(1:10, mgp = c(3, 1, 0)) with: plot(1:10, mgp = c(3, 2, 0)) HTH, Marc Schwartz