[Rd] axis() ignores supplied value of argument mgp?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Aug 4 11:53:50 CEST 2008
On Sun, 3 Aug 2008, J. R. M. Hosking wrote:
> 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
>> 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 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.
I don't think that is what it says. Setting 'line' or 'pos' temporarily
sets mgp to zero (which is what the help implies in parts you did not
Otherwise 'line' would just duplicate mgp.
> My interpretation is that axis() is taking mgp rather than the
> correct mgp-mgp as the relative position of the tick mark with
Why is it correct when you have been told 'mgp' was overridden?
We could explicitly say it is treated as zero for ultimate clarity.
> respect to the axis line.
> J. R. M. Hosking
> 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)
> R-devel at r-project.org mailing list
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
More information about the R-devel