Re: [Rd] axis() ignores supplied value of argument mgp[3]?

From: J. R. M. Hosking <>
Date: Sun, 03 Aug 2008 22:52:50 -0400

Prof Brian Ripley wrote:
> What is true is that the line is set before the inline setting of mgp is
> processed: it all depends on what 'supplied' means, and you supplied two
> values.
> This is changed in R-patched now.

Thank you, that works. Here is a perhaps related issue:

R Help on 'axis' for argument 'line' says "The relative placing of tick marks and tick labels is unchanged". But this appears not to be the case when graphics parameter mgp[3] is nonzero:

   plot(1:4, yaxt="n")
   axis(2, 1:2)
   axis(2, 3:4, line=1)

which one (or, at least, I) would expect to place all the tick labels the same distance into the margin, does not in fact do so.

My interpretation is that axis() is taking mgp[2] rather than the correct mgp[2]-mgp[3] as the relative position of the tick mark with respect to the axis line.

J. R. M. Hosking

 > R.version

platform       i386-pc-mingw32
arch           i386
os             mingw32
system         i386, mingw32
major          2
minor          7.1
year           2008
month          06
day            23
svn rev        45970
language       R

version.string R version 2.7.1 (2008-06-23) mailing list Received on Mon 04 Aug 2008 - 03:02:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Aug 2008 - 11:35:52 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive