Hi, I seem to recall coming across a function that allowed one to mouse-click on an xy-plot and obtain x and y coordinates. Can anyone remind me its name? Thanks, Nuno
Are you thinking of ?identify ? Nuno Prista wrote:> Hi, > > I seem to recall coming across a function that allowed one to mouse-click on an xy-plot and obtain x and y coordinates. Can anyone remind me its name? > > Thanks, > > Nuno > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
You can use identify() to obtain coordinates from plotted points but if you want any coordinates you could use locator():> plot(1:10) > loc <- locator(n=3) > str(loc)List of 2 $ x: num [1:3] 2.3 5.4 8.29 $ y: num [1:3] 6.15 8.33 2.6> points(loc$x, loc$y, col=2) >Walmes. ----- ..ooo0 ................................................................................................... ..(....)... 0ooo... Walmes Zeviani ...\..(.....(.....)... Master in Statistics and Agricultural Experimentation ....\_)..... )../.... walmeszeviani at hotmail.com, Lavras - MG, Brasil ............ (_/............................................................................................ -- View this message in context: http://n4.nabble.com/mouse-clicking-on-xy-plot-tp1749562p1749586.html Sent from the R help mailing list archive at Nabble.com.