[R] rpanel rp.tkrplot: x&y when using layout

Philip Wilson pwilson66 at gmail.com
Thu Feb 24 15:06:42 CET 2011


Hi all,

I wish to use rp.tkrplot from the rpanel package with subplots produced 
by layout or split.screen. My problem is that I want to use a click 
function, but I can't work out how to convert the x and y values it 
produces into the values on the plots as unlike for a single plot they 
don't match. For example in the following code the (0,0) and (1,1) 
corners of the bottom left plot are given as approx (-.1,-.05) and 
(.23,.45). Thanks for any help,

Philip Wilson


library(rpanel)
panel<-rp.control()
plots<-function(panel) {
par(mar=rep(1.5,4))
layout(rbind(1:3,4:6))
for (i in 1:6) plot(0:4*.25,runif(5),xlim=0:1,ylim=0:1)
}
click<-function(panel,x,y) {print(c(x,y)); panel}
rp.tkrplot(panel,plot1,plots,click,hscale=1.8,vscale=1.8)



More information about the R-help mailing list