How to change Lattice graphics default groups colors?
问题 When using groups , Lattice gives each group a different color. Example: df <- data.frame(x=1:56, y=rnorm(56), class=1:14) # create some data xyplot(y ~ x, groups=class, data=df, type="l", auto.key=list(space="right")) However, by default Lattice only uses seven colors, as running the example above will show. If you have more than seven groups, Lattice cycles through the colors again in order, causing data from distinct groups to have the same color. I learned from another Stackoverflow