Crump, Ron
2016-Sep-27 10:48 UTC
[R] ggplot grouped barchart based on marginal proportions
Hi Paul, Do you want to avoid using prop.table(mtcars_xtab, 1) ? If not, how about: ggplot(as.data.frame(prop.table(mtcars_xtab, 1)))+ geom_bar(aes(x=Var2,y=Freq,fill=Var1), stat="identity", position="dodge")+ scale_fill_brewer(palette="Set2") Ron.