Some Notes on panel.grid

The call used in panel.xyplot for type="g" is
  panel.grid(h = -1, v = -1)
The h and v values specify that grid positions should be determined by the same algorithm as used for determining standard axis tick marks, so will usually line them up. The default value of col.line and the like is obtained from
  trellis.par.get("reference.line")
so this is part of the theme. An example of adding a grid to Figure 5.12:
data(SeatacWeather, package = "latticeExtra") 
maxp <- max(SeatacWeather$precip, na.rm = TRUE) 
xyplot(min.temp + max.temp + I(80 * precip / maxp) ~ day | month,
       data = SeatacWeather, col = "black", lty = 1,
       ylab = "Temperature and Rainfall", type = c("l", "l", "h"),
       panel = function(...) {
           panel.grid(h = -1, v = -1)
           panel.xyplot(...)
       },
       distribute.type = TRUE)


Luke Tierney 2008-09-18