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

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon Apr 3 21:11:09 CEST 2006


On 4/1/06, Fredrik Karlsson <dargosch at gmail.com> wrote:
> Dear list,
>
> I am trying to plot  a barchart (from lattice) in B & W, with 10
> categories per bar.
> It seems that the colours are recycled after reachingcategory number
> 7, which creates a problem interpreting the chart. I therefore have
> two questions:
>
> 1) How do I get more shades?

Use the col argument:

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

or change the appropriate settings (the name of which is different in
R 2.2.x and 2.3.x, but see show.settings() in either case).

Deepayan
--
http://www.stat.wisc.edu/~deepayan/




More information about the R-help mailing list