R ggplot barplot; Fill based on two separate variables

前端 未结 3 1887
挽巷
挽巷 2020-12-13 20:31

A picture says more than a thousand words. As you can see, my fill is based on the variable variable.

Within each bar there is however mul

3条回答
  •  遥遥无期
    2020-12-13 20:46

    This is far from perfect, but hopefully a step in the right direction, as it's dodged by variable, but still manages to represent Complexity in some way:

    ggplot(short.m, aes(x=Method, y=value/100, group=variable, fill=variable, alpha=Complexity,)) + 
      geom_bar(stat="identity",position="dodge", colour="black") +
      scale_alpha_manual(values=c(0.1, 0.5, 1)) +
      coord_flip()
    

    enter image description here

提交回复
热议问题