[R] Tick marks in xyplot

Ingolfsson, Olafur olafur.ingolfsson at imr.no
Thu Jun 24 09:08:48 CEST 2004


Thank you for the tips, it is also good to know that the packages are getting even better.

I however solved it this way: 

lset(col.whitebg())
x.data <- rnorm(16,20,7);y.data <- rnorm(16,.55,.25); z.data <- sample(1:4,16,replace=T)
xyplot(y.data~x.data|z.data, layout=c(2,2),xlim=c(4,39),ylim=c(-.04,1.04),
       scales=list(x=list(alternating=F),y=list(alternating=F),tck=c(-1,0)),
       panel = function(x,y,...)
              {
               x.t <- c(5,5,5,10,10,10,15,15,15,20,20,20,25,25,25,30,30,30,35,35,35,rep(c(4,4,4.7),6))
       	       y.t <- c(rep(c(-0.04,-0.02,-0.04),7),-0.04,0,0,0,0.2,0.2,0.2,0.4,0.4,0.4,0.6,0.6,0.6,0.8,0.8,0.8,1,1)
               panel.xyplot(x.t,y.t,type="l",col=1)
               panel.xyplot(x,y)
              } )

I'm not trying to convince anyone that this is 'the elegant way', but it does the job.

Thanks again

Olafur A.I.




More information about the R-help mailing list