ligges@statistik.uni-dortmund.de
2001-Apr-25 15:24 UTC
[Rd] Re: identify.default ignores any setting of cex (PR#660)
A follow-up to PR#660 (15 Sep 2000) from Brian Ripley:> R 1.1.1 on Windows, but I think this is widespread. > > Using either > > par(cex=0.5) > plot(1:10) > identify(1:10) > > or > > plot(1:10) > identify(1:10, cex=0.5) > > ignores the cex setting. The root cause is that par(cex=0.5) > alters cexbase for the device but sets cex=1.0, and the internal > text plotting routines use cex and not cexbase. > > The obvious fix is to set cex to cexbase in do_identify. However, > if this is fixed, there is another problem, The offset of the label > is related to the cex in use for the label, and not for the symbol. > So > > plot(1:10, type="n") > points(1:10, cex=5) > identify(1:10) > > is not sensible in placing the labels. That may be hard to anticipate, > but > > plot(1:10) > identify(1:10, cex=0.5) > > needs to use cex=1 not cex=0.5 for the adjustment. Perhaps identify is > trying too hard, and should give the user more control over the precise > position of the label (as S-PLUS does).The same with par(cex=1); plot(1:10); text(4, 5, "Hello World") # OK par(cex=2); plot(1:10); text(4, 5, "Hello World") # OK par(cex=2); plot(1:10); text(4, 5, "Hello World", cex = 1) # NOT OK par(cex=2); plot(1:10); text(4, 5, "Hello World", cex = 0.5) So the scaling with cex in text() is relative to the par() settings, which is not the expected behaviour. [R-1.2.2 on WinNT 4.0] 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian D Ripley
2001-Apr-25 17:55 UTC
[Rd] Re: identify.default ignores any setting of cex (PR#660)
On Wed, 25 Apr 2001 ligges@statistik.uni-dortmund.de wrote:> A follow-up to PR#660 (15 Sep 2000) from Brian Ripley:[...]> The same with > > par(cex=1); plot(1:10); text(4, 5, "Hello World") # OK > par(cex=2); plot(1:10); text(4, 5, "Hello World") # OK > par(cex=2); plot(1:10); text(4, 5, "Hello World", cex = 1) # NOT OK > par(cex=2); plot(1:10); text(4, 5, "Hello World", cex = 0.5) > > So the scaling with cex in text() is relative to the par() settings, > which is not the expected behaviour.It is the documented behaviour, though: see the description of cex in ?help. cex: numeric character expansion factor; multiplied by `par("cex")' yields the final character size. Brian -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._