maechler@stat.math.ethz.ch
2000-Nov-07 12:03 UTC
[Rd] par(las=.) gives wrong "adj" for mtext() (PR#726)
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 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") Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ligges@statistik.uni-dortmund.de
2000-Nov-07 13:43 UTC
[Rd] par(las=.) gives wrong "adj" for mtext() (PR#726)
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.5That'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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
2000-Nov-08 11:27 UTC
[Rd] par(las=.) gives wrong "adj" for mtext() (PR#726)
>>>>> "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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._