[Rd] par(las=.) gives wrong "adj" for mtext() (PR#726)

ligges@statistik.uni-dortmund.de ligges@statistik.uni-dortmund.de
Tue, 7 Nov 2000 14:43:59 +0100 (MET)

maechler@stat.math.ethz.ch wrote:
> For R Version 1.1.1 and R-devel (Linux)...
> Sorry, there's no time to fix myself now
> {e.g., after starting a new device} :
>     par(las=3); plot(1:10); par(las=1) ; mtext("mtext")
> Gives a left-adjusted (as for  adj = 0)  mtext,
> even if  par("adj") is still 0.5

That's not a bug, I suppose. From help of mtext():

adj  adjustment for each string. [......]
     If adj is not a finite value (the default), 
                                       ^^^^^^^ = NA, not from par("adj")
     the value par("las") determines the adjustment. 
     For strings plotted parallel to the axis the default is to centre
the string. 

> Note that I'm also not convinced that  mtext() should follow  par("las")
> as it does in the following {2nd bug ?} :
>     par(las=3); plot(1:10); mtext("mtext")

Everything is vertical, here (R-1.1.1, WinNT4.0). I don't see a second
bug ...

But I think most users don't expect the behavior of mtext(). Maybe some
changes are useful:

1. The above described "bug", maybe centre all strings as the default
(and not only those strings plotted parallel to the axis), so there are
not so much dependencies between the settings of "adj" and "las".

2. Have a look at:

      mtext("text1", adj=0.2)
      mtext("text2", adj=0.8)

This is intended (from the help), but I would expect (without reading
the help at first) the following result:
      mtext("text1", adj=0.2, at=5.5)
      mtext("text2", adj=0.8, at=5.5)

Additionally: The argument "adj" in mtext() does not support adj=c(x, y)
as described in ?par.

Uwe Ligges

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