From maechler@stat.math.ethz.ch  Wed Nov  8 11:27:39 2000
From: maechler@stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed, 8 Nov 2000 12:27:39 +0100 (MET)
Subject: [Rd] par(las=.)  gives wrong "adj" for mtext() (PR#726)
Message-ID: <200011081127.MAA02281@pubhealth.ku.dk>

>>>>> "Uwe" == Uwe Ligges <ligges@statistik.uni-dortmund.de> writes:

    Uwe> 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


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

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

Note that above, I had already reset  "par(las = 1)"
*before* doing  mtext(.) !

--------

    >> 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")


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

yes, and I didn't say so, I said
"not convinced that mtext() should ..."

I think you have good  points below :

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

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

    Uwe> 2. Have a look at:

    Uwe> par("las"=3)
    Uwe> plot(1:10)
    Uwe> mtext("text1", adj=0.2)
    Uwe> mtext("text2", adj=0.8)

    Uwe> This is intended (from the help), but I would expect (without reading
    Uwe> the help at first) the following result:
 
    Uwe> par("las"=3)
    Uwe> plot(1:10)
    Uwe> mtext("text1", adj=0.2, at=5.5)
    Uwe> mtext("text2", adj=0.8, at=5.5)

Request for comments :  
Shouldn't we change the behavior() of mtext() here?

----


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

yes, but the `adj' argument of mtext()  *is*  documented explicitly,
(partly for that reason!).


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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)
maechler@stat.math.ethz.ch