title: Change symbol colors in barchart legend
body: <p>I have searched through this site and others and can't seem to find the problem in my code. I am trying to change the symbol colors in my <code>barchart</code> legend to correspond to the colors I specified when making the chart (using the lattice package). </p>
  
  <p>For the legend, I am using the <code>auto.key</code> function. The bars correspond to bird counts for several treatments. I first had to aggregate the bird counts for each species by each treatment. I don't get any error messages with this code, but the symbol colors in the legend are the default colors rather than the 5 colors I specified to coordinate with the 5 bird species. Here is my code: </p>
  
  <pre><code>birds.trmt &lt;- aggregate(cbind(BRSP, GTTO, HOLA, VESP, WEME)~treatment, 
      data=EM.bird.plots, FUN=sum)
  
  library(lattice)
  
  barchart(BRSP+GTTO+HOLA+VESP+WEME~treatment, 
       data=birds.trmt, 
       par.settings=list(
         superpose.symbol=list(col=c("brown", "green", "yellow","red", "blue"),
         fill=c("brown", "green", "yellow","red", "blue"))),
        col=c("brown", "green", "yellow", "red", "blue"),
        main="Bird Counts by Treatment", 
        xlab="treatment",
        ylab="songbird count", 
        cex.main=2, 
        cex.lab=1.2, 
        auto.key=list(space="right"))
  </code></pre>