[Rd] "trace" argument in legend() (PR#2578)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Tue Feb 25 10:26:06 2003


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