Dear R group I am making multiple xyplot, and would like to have tick marks on bottom and left in EACH panel, but only tick labels at the bottom and left of the whole graph. I have browsed the internet, as well as the help page without success. If anyone could help me find the path to the solution I would appreciate. Here is an example, this is the best I could do: 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), scales=list(x=list(alternating=F),y=list(alternating=F),tck=c(-1,0))) Cheers ??lafur A. Ing??lfsson Institute of Marine Research PO Box 1870 Nordnes 5817 Bergen, Norway
On Wednesday 23 June 2004 06:36, Ingolfsson, Olafur wrote:> Dear R group > > I am making multiple xyplot, and would like to have tick marks on > bottom and left in EACH panel, but only tick labels at the bottom and > left of the whole graph. I have browsed the internet, as well as the > help page without success. If anyone could help me find the path to > the solution I would appreciate. Here is an example, this is the best > I could do:I don't think there is good way to do this in the way you expect (I'm assuming you want the same axis limits for each panel). If you really want this, look at the following options: 1. You can specify the limits, tick positions, and axis labels individually for each panel (see documentation for 'scales' in ?xyplot; all the relevant components - at, lab, etc - can be lists). Use this in conjunction with relation = "free". You need to supply empty strings as labels for all the 'inside' panels. 2. The big problem this would have is that the same amount of space would be allocated for the axis labels in each of the panels, even if that space is not used for the inside ones. One (undocumented and unreliable) way to get around that would be to use negative values of 'between'. Hope that helps, Deepayan
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.