Re: [R] Overlaying Barplots

From: Martyn Plummer <plummer_at_iarc.fr>
Date: Wed 08 Jun 2005 - 22:28:45 EST

On Wed, 2005-06-08 at 12:07 +0200, Sven C. Koehler wrote:
> Hello!
>
> I would like to overlay barplot(1:10) with a barplot(seq(1:5, each=2)),
> indicating that 50% of each bar belongs to category X. How do I do this
> in R?

If you pass a matrix to barplot, it will stack values from the same column on top of each other. So something like

barplot(rbind(1:10, 1:10))

will do what you want.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 08 22:39:23 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:27 EST