J. R. M. Hosking
2008-Jul-19 20:24 UTC
[Rd] axis() ignores supplied value of argument mgp[3]?
It seems that when an argument 'mgp' is supplied to axis(), the mgp[2] value (position of tick mark labels) is honoured but the mgp[3] value (position of axis line) is ignored. Example: plot(1:5, xaxt='n', ann=FALSE) par(mgp=c(0,2,1)) axis(1, at=2:4, mgp=c(0,-2,-3)) Axis line is plotted at margin line 1, tick mark labels at line -3. Is this a bug? J. R. M. Hosking > R.version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status 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)
Prof Brian Ripley
2008-Jul-29 15:14 UTC
[Rd] axis() ignores supplied value of argument mgp[3]?
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. On Sat, 19 Jul 2008, J. R. M. Hosking wrote:> It seems that when an argument 'mgp' is supplied to axis(), > the mgp[2] value (position of tick mark labels) is honoured > but the mgp[3] value (position of axis line) is ignored. > Example: > > plot(1:5, xaxt='n', ann=FALSE) > par(mgp=c(0,2,1)) > axis(1, at=2:4, mgp=c(0,-2,-3)) > > Axis line is plotted at margin line 1, tick mark labels at line -3. > > Is this a bug? > > > J. R. M. Hosking > > > >> R.version > _ > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > 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) > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- 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