[R] barchart in black & white with 10 categories?

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue Apr 4 00:56:34 CEST 2006

On 4/3/06, Fredrik Karlsson <dargosch at gmail.com> wrote:
> Thank you Deepayan for your reply.
> Using your example, I was able to get bars in greyscale that separates
> nicelly in Black and white. However, I cannot get the key to do the
> same. All I can do, using hte col argument of
> simpleKey, is to get the legend text to shade go through all the grey
> scales, with color boxes
> by the text.

Sorry, I wasn't paying attention. Use par.settings instead of col, e.g.

barchart(site ~ yield | year, data = barley, groups = variety,
         stack = TRUE, auto.key = TRUE,
         par.settings = list(superpose.polygon = list(col = gray.colors(10))))

superpose.polygon should be superpose.fill (IIRC) in R 2.2.x


More information about the R-help mailing list