[R] lattice.xyplot: adding grid lines

Marc Mamin M.Mamin at intershop.de
Tue Sep 9 11:49:08 CEST 2003


Hallo,

I'd like to add grid lines to a lattice graph having 2 series of Y data.

See these 2 examples:



data(iris)

[1]
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length ,
            data = iris, allow.multiple = TRUE, scales = "same",type="l",
)


[2]
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length ,
            data = iris, allow.multiple = TRUE, scales = "same",type="l",
panel = function(x, y) {
  panel.grid(h=2, v= 3)
   panel.xyplot(x, y)
  }
)


Question:  is it possible to keep all the formats of example [1] (colors,
type="l", ...), and just add the grids appearing in example 2.
Moreover I'd like to choose the color of the grid...

Thanks for you help,

Marc Mamin




More information about the R-help mailing list