Skip to content
Prev 131208 / 398502 Next

Multiple stacked barplots on the same graph?

Perhaps this could be useful:
 > x=scan()
11.81 10.51  1.95  2.08  2.51  2.05  1.98  0.63  0.17  0.20
12.49 13.56 2.81  3.13  4.58  0.70  0.85  0.22  0.06  0.03

 > x=matrix(x,5,4,byrow=T)
 > rownames(x)=paste("comp",1:5,sep="")
 > colnames(x)=paste("c",1:4,sep="")

 > library(ggplot2)
 > dfm=melt(x)
 > qplot(as.factor(x=X1),y=value,geom="histogram",data=dfm,fill=X2)

domenico vistocco
St?phane CRUVEILLER wrote: