From ligges@statistik.uni-dortmund.de  Wed Apr 25 16:24:44 2001
From: ligges@statistik.uni-dortmund.de (ligges@statistik.uni-dortmund.de)
Date: Wed, 25 Apr 2001 17:24:44 +0200 (MET DST)
Subject: [Rd] Re: identify.default ignores any setting of cex (PR#660)
Message-ID: <200104251524.RAA02124@pubhealth.ku.dk>

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


[Rd] Re: identify.default ignores any setting of cex (PR#660)
ligges@statistik.uni-dortmund.de