Re: [R] clicking on plot and recording XY coords

From: jim holtman <jholtman_at_gmail.com>
Date: Fri, 20 Jun 2008 23:34:31 -0400

?locator

On Fri, Jun 20, 2008 at 11:25 PM, milton ruser <milton.ruser_at_gmail.com> wrote:
> Dear all,
>
> I need to run a interactive procedure where the user
> will need click on the screen (over a XY plot)
> and I need to record the XY coordinate which the
> user clicked. Roughly I wrote a short code below.
> You see that I suppose that the user will choose
> four coordinates inside the region of intersection
> between three segmentes. On each click, I would like to
> record the position clicked in a vector.
> Any help are welcome.
>
> Miltinho
> -----
> number.clicks<-4
> for (i in 1:number.clicks)
> {
> plot(0,0, type="n")
> seg1<-arrows(-0.5,-1,0.5,0, col=1)
> seg2<-arrows(0,-1,-0.3,0.3, col=2)
> seg3<-arrows(0.2,-0.7,-0.5,0, col=4)
> # here I would like click on PLOT
> # and record de XY position
> # before go to next aquisition
> }
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
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.
Received on Sat 21 Jun 2008 - 04:14:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 21 Jun 2008 - 05:30:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive