Re: [R] locator

2005-10-21 Thread tom wright
Perfect, thankyou On Fri, 2005-21-10 at 15:46 -0400, Duncan Murdoch wrote: > On 10/21/2005 11:23 AM, tom wright wrote: > > I'm trying to use the locator function on a drawing area with multiple > > graphs par(mfrow=c(1,2)) > > Is it possible to identify which graph has been clicked? > > locator()

Re: [R] locator

2005-10-21 Thread Duncan Murdoch
On 10/21/2005 11:23 AM, tom wright wrote: > I'm trying to use the locator function on a drawing area with multiple > graphs par(mfrow=c(1,2)) > Is it possible to identify which graph has been clicked? locator() will return coordinates based on the active graph (typically the last one you drew), s

[R] locator

2005-10-21 Thread tom wright
I'm trying to use the locator function on a drawing area with multiple graphs par(mfrow=c(1,2)) Is it possible to identify which graph has been clicked? thanks tom __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] locator() via tcltk

2005-06-05 Thread Prof Brian Ripley
On Sun, 5 Jun 2005, Sebastian Luque wrote: Dear List members, Thank you so much for your insights. On Sat, 4 Jun 2005 09:39:33 +0100 (BST), Prof Brian Ripley <[EMAIL PROTECTED]> wrote: [...] I think it is more likely you want to wait for the Tk interaction and then return the results, that

Re: [R] locator() via tcltk

2005-06-05 Thread Sebastian Luque
Dear List members, Thank you so much for your insights. On Sat, 4 Jun 2005 09:39:33 +0100 (BST), Prof Brian Ripley <[EMAIL PROTECTED]> wrote: [...] > I think it is more likely you want to wait for the Tk interaction and > then return the results, that is use a `modal' widget. If so, take a > l

Re: [R] locator() via tcltk

2005-06-04 Thread Jean . Coursol
To illustrate (?) Professor Ripley comments, I send you an example (stolen in various places...). Note the tkwm.resizable(tt, 0, 0) directive that prevents the window rescaling (if not,the coordinates will not be correct). # # Getting the mouse coords with TclTk # # Two possibilities: tkrplot pa

Re: [R] locator() via tcltk

2005-06-04 Thread Prof Brian Ripley
You have two asynchronous processes here: your R function will return, leaving a Tk widget up. Duncan Murdoch's solution is to give you a function that will retrieve at some future stage the result of the last press (if any) of "Get coordinates" button. Is that what you want? I think it is m

[R] locator()

2005-06-03 Thread Erin Hodgess
Dear Sebastian: Here is a snippet of code that you may find interesting for labeling points on the plane: plane1 <- function(x,main1="") { plot(x,main=main1,ylab=" ") zz <- locator() text(zz$x,zz$y, labels=paste("(",round(zz$x,1), ",",round(zz$y,1),")",sep=""), pos=2

Re: [R] locator() via tcltk

2005-06-03 Thread Duncan Murdoch
Sebastian Luque wrote: Hello, I'm trying to write a function using tcltk to interactively modify a plot and gather locator() data. I've read Peter's articles in Rnews, the help pages in tcltk, http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/, plus a post in R-help sometime ago, but haven't

[R] locator() via tcltk

2005-06-03 Thread Sebastian Luque
Hello, I'm trying to write a function using tcltk to interactively modify a plot and gather locator() data. I've read Peter's articles in Rnews, the help pages in tcltk, http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/, plus a post in R-help sometime ago, but haven't found a solution. The ide

[R] locator and multiple plots

2004-11-23 Thread Stephane DRAY
Hello, I would like to know if it possible to use locator() only on one region of a graphic device. I would like to fragment a graphic device into sub-regions (using layout or split.screen or any other functions that I do not know) and then use locator. but I want that the locator is only used f

Re: [R] locator() in a multi-figure setting using mfrow(): SOLVED

2004-09-09 Thread Christoph Lehmann
thanks to some great hints by Paul Murrel I could solve it: here we are with one solution (code needs to be cleaned and simplified, but maybe one can understand it) ### ## create a multifigure setting nr <- 4 nc <- 2 opar <- par(mfrow = c(nr, nc)) slices <- 8 m <- matrix(runif(100),10,10) my

Re: [R] locator() in a multi-figure setting using mfrow()

2004-09-06 Thread Christoph Lehmann
I know, that I can use par(mfg = c(i,u)) to get the correct x,y coordinates of one of the 8 matrices/subimages, but how can I get the i and the j, means how can I know in which of the 8 images I am clicking in? thanks Christoph Christoph Lehmann wrote: Hi based on some code from Thomas Petzoldt

[R] locator() in a multi-figure setting using mfrow()

2004-09-06 Thread Christoph Lehmann
Hi based on some code from Thomas Petzoldt (see below), I have a question, about how to use locator() in a mfrow() multi-figure setting. I am sure this should be a kind of problem, which other people face too? we have 8 matrices each 10x10 fields, plotted as mfrow = c(2,4). how can I get, using

Re: [R] locator() in a multiple plot setting

2004-07-13 Thread Barry Rowlingson
p <- locator(1) c(round(p$x), round(p$y)) --- how can I get the "correct" location in the sense of a 3d info: (a) which slice (p$slice) (b) p$x (c) p$y Okay, purely off the top of my head here... You can use par()$usr, par()$plt, and par()$fig to transform from locator()'s coordinates to device c

[R] locator() in a multiple plot setting

2004-07-13 Thread Christoph Lehmann
Hi based on some code from Thomas Petzoldt, I have a question: --- opar <- par(mfrow = c(2,4)) slices <- 8 m <- matrix(runif(100),10,10) my.list <- list() for (slice in 1:slices) { my.list[[slice]] <- m } for (slice in 1:slices) { x <- 1*(1:25) y <- 1*(1:25) z <- my.list[[slice]]

Re: [R] locator(n=0)

2004-02-27 Thread Dirk Eddelbuettel
Peter, On Fri, Feb 27, 2004 at 10:16:54AM +0100, Peter Wolf wrote: > locator(n=1) returns the coordinates of the position of the mouse. > But you have to click the left button of the mouse. > How can I determine the mouse position without any click? > Is it possible to extend locator in a way tha

Re: [R] locator(n=0)

2004-02-27 Thread Barry Rowlingson
Peter Wolf wrote: locator(n=1) returns the coordinates of the position of the mouse. But you have to click the left button of the mouse. How can I determine the mouse position without any click? Is it possible to extend locator in a way that locator(n=0) outputs the coordinates at once, without a

Re: [R] locator(n=0)

2004-02-27 Thread Prof Brian Ripley
There is nothing in the design of R base graphics to report the current position of the mouse without clicking. Indeed, the graphics model does not presume a mouse and pointer (and probably dates from the days of cross-hairs manipulated with thumb wheels), and could conceivably use a touchscre

[R] locator(n=0)

2004-02-27 Thread Peter Wolf
locator(n=1) returns the coordinates of the position of the mouse. But you have to click the left button of the mouse. How can I determine the mouse position without any click? Is it possible to extend locator in a way that locator(n=0) outputs the coordinates at once, without any click event? T

Re: [R] locator in multiple graphics

2003-09-15 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: hello, how i cant with function locator() know the coordinates of two function graphicated in the same graphical area, the return coordinates which are they , of one function or the another function: |f | /(click here) locator(1), return (x,y) of f or g function?

[R] locator in multiple graphics

2003-09-15 Thread solares
hello, how i cant with function locator() know the coordinates of two function graphicated in the same graphical area, the return coordinates which are they , of one function or the another function: |f | /(click here) locator(1), return (x,y) of f or g function? | / | / |/~g |_