[R] barplot (stacked)

K. Elo maillists at nic.fi
Wed Mar 24 16:24:13 CET 2010


Hi Jens!

24.03.2010 14:48, koj wrote
> 
> Hi Kimmo, thank you for your answer, but this is not the thing I am searching
> for. Unfortunately, I have not described the problem very good. But just in
> this moment I have a good idea: I use add=TRUE and paint two plots. And so I
> am sure that I can solve the problem. 

Just to satisfy my curiosity: does the following code solve Your problem
(once again, dm refers to your data matrix):

--- cut here ---
barplot(dm[,seq(1,20,2)], col="grey", space=2)
barplot(dm[,seq(2,20,2)], add=T, col=c("blue","green"), space=c(3,rep(2,9)))
--- cut here ---

Regards,
Kimmo



More information about the R-help mailing list