[R] Setting user colors in barchart

Richard.Cotton at hsl.gov.uk Richard.Cotton at hsl.gov.uk
Tue Sep 16 18:44:08 CEST 2008

> Thank you for a clear example, it works. I tried to play with 
> superpose.polygon before to no avail, this clarifies things.

You're welcome.

> Another question: would you know how to add gridlines to the plot? 
> I'd like to have a few horizontal gridlines on my barchart plot for 
> better readability. Do I have to write a wrapper for panel.barchart?

Probably, but it's not as bad as it sounds.  To reuse the previous 

barchart(yield ~ site,
  data = barley,
  panel=function(...){panel.barchart(...); panel.grid(v=0, ...)})

(The v=0 argument stop vertical grid lines being drawn.)


Mathematical Sciences Unit


This message contains privileged and confidential inform...{{dropped:20}}

More information about the R-help mailing list