Hello all Simple question for the gurus. I'm trying to interactively label curves on a single plot. The labcurve() function from Hmisc seems like the way to do this (?). I just can't seem to get it to work. Toy example: > x <- 1:10 > y1 <- x^2 > y2 <- 2*x > plot(x,y1) > lines(x,y2) > labcurve(labels=c("curve1", "curve2"), method="locator") From the help file, this is how I would understand it should be done, but have tried many other combinations, with no luck. Running up-to-date R, R packages and Fedora. Many thanks, Quin -- * * * * * * *Quin Wills* *DPhil candidate* * * *Department of Statistics* *University** of Oxford*** *1 South Parks Road* *Oxford*** *OX1 3TG United Kingdom* *01865 285 394* [[alternative HTML version deleted]]
Frank E Harrell Jr
2007-Oct-20 16:20 UTC
[R] unable to interactively label curves on a plot
Quin Wills wrote:> Hello all > > Simple question for the gurus. I'm trying to interactively label curves > on a single plot. The labcurve() function from Hmisc seems like the way > to do this (?). I just can't seem to get it to work. Toy example: > > > x <- 1:10 > > y1 <- x^2 > > y2 <- 2*x > > plot(x,y1) > > lines(x,y2) > > labcurve(labels=c("curve1", "curve2"), method="locator") > > From the help file, this is how I would understand it should be done, > but have tried many other combinations, with no luck. > > Running up-to-date R, R packages and Fedora. > > Many thanks, > Quin >Please take time to read the help file for labcurve which makes it clear that you need to give it the data as well as the curve labels. Also specify pl=TRUE. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University