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

Fredrik Karlsson dargosch at gmail.com
Mon Apr 3 23:22:07 CEST 2006


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.

print(
  barchart(
  prop.table(pd,margin=1),
  auto.key=list(
  space="right",
  col=gray.colors(10)
     ),
  xlab="Relative Frequency",
  ylab="Age (months)",
  col = gray.colors(10)
  )
)



On 4/3/06, Deepayan Sarkar <deepayan.sarkar at gmail.com> wrote:
> 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/
>


--
My Gentoo + PVR-350 + IVTV + MythTV blog is on
http://gentoomythtv.blogspot.com/




More information about the R-help mailing list