Hello list! I have a set of data like this:> alldata[1:5,]breaks numbers disttype moltype type 1 0.0000000 6598 Gapped Distances 5S Between species 2 0.4066667 0 Gapped Distances 5S Between species 3 0.8133333 5228 Gapped Distances 5S Between species 4 1.2200000 0 Gapped Distances 5S Between species 5 1.6266667 9702 Gapped Distances 5S Between species> levels(alldata$disttype)[1] "Gapped Distances" "Ungapped Distances"> levels(alldata$type)[1] "Between species" "Same species"> levels(alldata$moltype)[1] "16S" "23S" "5S">Which I plot like this: xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type, data = alldata) This results in a plot consisting of six different panels. Now, I have a set of six different values that I would like to incorporate into these plots through a vertical line in each panel (one separate value per panel). I think I can do this through panel.abline somehow, but I don't know how to incoporate that into the xyplot command, and I don't know how to specify which values I want plotted in each plot. I hope I am able to convey what I want:) Thanks in advance, karin -- Karin Lagesen, PhD student karin.lagesen at medisin.uio.no http://folk.uio.no/karinlag
Hi Karin, Try this xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type, data = alldata, panel = function(x, y, ...){ panel.abline(h = 0, col.line = 1) panel.xyplot(x, y, ..., pch = 1, col.symbol = 1)}) Look at panel.abline in the lattice help for more details. Here, "h = 0" will plot a horizontal line at y = 0 in each of your panels. Similarly, "v = 0" will plot a vertical line at x = 0 in each of your panels. You will need to build a vector to plots these lines at different coordinates. Sebastien