From ligges@statistik.uni-dortmund.de  Tue Nov  7 13:43:59 2000
From: ligges@statistik.uni-dortmund.de (ligges@statistik.uni-dortmund.de)
Date: Tue, 7 Nov 2000 14:43:59 +0100 (MET)
Subject: [Rd] par(las=.)  gives wrong "adj" for mtext() (PR#726)
Message-ID: <200011071343.OAA21680@pubhealth.ku.dk>

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:

      par("las"=3)
      plot(1:10)
      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:
 
      par("las"=3)
      plot(1:10)
      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.



Regards,
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] par(las=.) gives wrong "adj" for mtext() (PR#726)
ligges@statistik.uni-dortmund.de