[R] setting trellis auto.key color values

Steve_Friedman at nps.gov Steve_Friedman at nps.gov
Tue May 5 17:32:32 CEST 2009

I'm working with Lattice graphics and I would like very much to color code
the auto.key fill color with the same corresponding colors that I use in
the panels.  I've looked on the web for clues, and on the CRAN-R help sites
searching on "trellis auto.key color" and variations, unfortunately the
responses there are not very specific.

 Would someone please explain   I have the Book, if you can point me to the
pages that explain this I'd appreciate that too

> graph.sets <- list(axis.text = list(cex = 0.65),
              par.ylab.text = list(cex = 1.25),
              par.xlab.text = list(cex = 1.25))

>   barchart(gator_IR$MEAN ~ gator_IR$Hydro |
as.factor(gator_IR$IR_ID),layout=c(4,1),col = c(3:5),
                 groups=gator_IR$Rain, ylim=c(0,1), par.settings =
                 main = "Alligator Nesting Performance", ylab= "Mean HSI",
                 auto.key = list("top", columns=3, col=c(3:5))

this script creates the graph nicely, with the qualification that the color
for the key titles are the correct, but the filling colors are default
pastels.  Where do I change them ?

Windows XP  with R 2.8.1

Thank you.


Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Steve_Friedman at nps.gov
Office (305) 224 - 4282
Fax     (305) 224 - 4147

More information about the R-help mailing list