Stacked histogram from already summarized counts using ggplot2

前端 未结 3 2062
别跟我提以往
别跟我提以往 2021-01-02 06:29

I would like some help coloring a ggplot2 histogram generated from already-summarized count data.

The data are something like counts of # males and # females living

3条回答
  •  旧时难觅i
    2021-01-02 07:05

    How about:

    library("reshape2")
    mm <- melt(X[,1:2])
    ggplot(mm,aes(x=value,fill=variable))+geom_histogram(position="stack")
    

提交回复
热议问题