[Rd] par(mgp) bug (PR#916)

paul@stat.auckland.ac.nz paul@stat.auckland.ac.nz
Tue, 19 Jun 2001 03:36:14 +0200 (MET DST)


> The behaviour of the third argument of par(mgp), which controls the
> placement of the axis ticks, is not working.
> In the following example, the plots should NOT be
> identical; the axis ticks plus the axis major line should be drawn one
> line out from the edges of the plot region.
> par(mfrow=c(2,1))
> plot(1:10)
> par(mgp=c(3,1,1))
> plot(1:10)

This is more of an incompatibility-with-S rather than a bug.  In R,
axis(pos=) overrides axis(line=) which overrides par(mgp=).  It is possible
to get axis to respond to par(mgp=), but this is NOT the default behaviour.
For example,

par(mgp=c(3, 1, 1))
plot(1:10, axes=F)
axis(1, line=NA)

In S, par(mgp=) specifies locations RELATIVE TO axis(line=), which can be
overridden by axis(pos=).

So the options are:
(i) become compatible NOW (for 1.3)
(ii) become compatible later
(iii) remain incompatible

I think we should do (i), especially because the default behaviour, which I
think would cover 99.999% of user code, would NOT change.

This is your chance to disagree ...


r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch