Full_Name: Jerome Asselin Version: 1.6.2 OS: RedHat Linux 7.2 Submission from: (NULL) (142.103.173.179) Should be an easy fix... Consider the examble below: plot(0,0) legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T) It gives the following trace:> plot(0,0) > legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T)xchar= 0.05178 ; (yextra,ychar)= 0 0.07941 rect2(0,0, w=0.3474, h=0.2382...) segments2(0.015540.01554,-0.07941-0.1588, dx=0.1036, dy=0, ...) points2( 0.06732 0.06732 , -0.07941 -0.1588 , pch= 1 2 ...) On the line starting by "segment2", the coordinates are not separated by a space like on the line starting by "points2". My recommendation is to remove the option `sep = ""' in this part of code in legend(). [...] if (trace) catn(" segments2(", xt[ok.l] + x.off * xchar, ",", yt[ok.l], ", dx=", seg.len * xchar, ", dy=0, ...)", sep = "") [...] Sincerely, Jerome Asselin
maechler@stat.math.ethz.ch
2003-Feb-25 10:26 UTC
[Rd] "trace" argument in legend() (PR#2578)
>>>>> "Jerome" == Jerome Asselin <jerome@hivnet.ubc.ca> >>>>> on Mon, 24 Feb 2003 18:53:30 +0100 (MET) writes:.... Jerome> Should be an easy fix... Jerome> Consider the examble below: Jerome> plot(0,0) Jerome> legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T) Jerome> It gives the following trace: >> plot(0,0) >> legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T) > xchar= 0.05178 ; (yextra,ychar)= 0 0.07941 > rect2(0,0, w=0.3474, h=0.2382...) > segments2(0.015540.01554,-0.07941-0.1588, dx=0.1036, dy=0, ...) > points2( 0.06732 0.06732 , -0.07941 -0.1588 , pch= 1 2 ...) Jerome> On the line starting by "segment2", the coordinates Jerome> are not separated by a space like on the line Jerome> starting by "points2". Jerome> My recommendation is to remove the option `sep = ""' Jerome> in this part of code in legend(). Jerome> [...] Jerome> if (trace) Jerome> catn(" segments2(", xt[ok.l] + x.off * xchar, ",", Jerome> yt[ok.l], ", dx=", seg.len * xchar, ", dy=0, ...)", Jerome> sep = "") Jerome> [...] Thank you, Jerome. Yes, it's a buglet and your suggestion is fine. Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><
Oops. I forgot this one. We should also replace "...)" by ", ...)" in this part of the code. [...] if (trace) catn(" points2(", x1, ",", y1, ", pch=", pch[ok], "...)") [...] Jerome On Tuesday 25 February 2003 01:20, Martin Maechler wrote:> >>>>> "Jerome" == Jerome Asselin <jerome@hivnet.ubc.ca> > >>>>> on Mon, 24 Feb 2003 18:53:30 +0100 (MET) writes: > > .... > > Jerome> Should be an easy fix... > > Jerome> Consider the examble below: > > Jerome> plot(0,0) > Jerome> legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T) > > Jerome> It gives the following trace: > >> plot(0,0) > >> legend(0,0,c("Hello!","Hi!"),pch=1:2,lty=1:2,trace=T) > >> > > xchar= 0.05178 ; (yextra,ychar)= 0 0.07941 > > rect2(0,0, w=0.3474, h=0.2382...) > > segments2(0.015540.01554,-0.07941-0.1588, dx=0.1036, dy=0, ...) > > points2( 0.06732 0.06732 , -0.07941 -0.1588 , pch= 1 2 ...) > > Jerome> On the line starting by "segment2", the coordinates > Jerome> are not separated by a space like on the line > Jerome> starting by "points2". > > Jerome> My recommendation is to remove the option `sep = ""' > Jerome> in this part of code in legend(). > > Jerome> [...] > Jerome> if (trace) > Jerome> catn(" segments2(", xt[ok.l] + x.off * xchar, ",", > Jerome> yt[ok.l], ", dx=", seg.len * xchar, ", dy=0, ...)", > Jerome> sep = "") > Jerome> [...] > > Thank you, Jerome. > Yes, it's a buglet and your suggestion is fine. > > Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ > Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 > ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND > phone: x-41-1-632-3408 fax: ...-1228 <><-- Jerome Asselin (Jérôme) Statistical Analyst British Columbia Centre for Excellence in HIV/AIDS St. Paul's Hospital 608 - 1081 Burrard Street Vancouver, British Columbia CANADA V6Z 1Y6 Email: jerome@hivnet.ubc.ca Phone: 604 806-9112 Fax: 604 806-9044