Is it possible to ask a plot window for its position in R?
I'm doing some plotting whereby a number of windows get successively opened, and it would be useful if these appeared at the same position and with the same size as previous graph windows for quick comparison.
I can get the size of a window via
dev.size and set the size of subsequent windows with this.
However, how can I get the position of the window?
(Imagine the first graph pops up - the user moves and resizes it to suit them. All subsequent windows should appear at that position/size so it almost looks like an animation, making it easier to tell what has changed between subsequent graphs.
I can't simply use the same graph window and graph over the top of it, because sometimes I want to remove lines from the graph (keeping all else the same) as opposed to adding them.)
preguntado el 04 de julio de 12 a las 03:07
As I recall you cannot do this as "R does not know", only the window manager does and there is no callback mechanism between the window manager and the application, ie R, that is passed through to us as application level developers.