Re: [R] bar plot colors

From: John Kane <jrkrideau_at_yahoo.ca>
Date: Wed, 19 Dec 2007 09:52:40 -0500 (EST)

> John Kane wrote:
> > I think you're going to find that barchart with
> that
> > many values in a bar is going to be pretty well
> > uninterpretable.
> >
> > Jim Lemon gives the desired barchart but it is
> very
> > difficult to read.
> >
> > Stealing his code to create the same matrix I'd
> > suggest may be looking at a dotchart. I'm not
> sure if
> > this is even close to an optimal solution but I do
> > think it's a bit better than a barchart approach
> >
>



> > heights<-matrix(sample(10:70,54),ncol=3)
> > bar.colors<-rep(rep(2:7,each=3),3)
> > cost.types <- c("Direct", "Indirec", "Induced")
> > colnames(heights) <- c("A", "B", "C")
> > rownames(heights) <- c(rep(cost.types, 6))
> >
> > dotchart(heights, col=bar.colors, pch=16, cex=.6)
> >
> >
>


> Very nice John, but it does look like someone
> dropped the M&Ms.
> Jim

Please I'm Canadian, we have Smarties. Much nicer than M&Ms :)

It is a bit garish but I didn't see a fast way to turn off the colours on the axis though from the Help it looks possible.

[[replacing trailing spam]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 19 Dec 2007 - 14:55:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 Dec 2007 - 16:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.