ggplot boxplot + fill + color brewer spectrum

前端 未结 1 528
臣服心动
臣服心动 2020-12-22 00:27

I can\'t seem to be able to fill a boxplot by a continuous value using color brewer, and I know it must just be a simple swap of syntax somewhere, since I can get t

相关标签:
1条回答
  • 2020-12-22 01:06

    If you need to set fill for the boxplots then instead of color=animals use fill=animals and the same way replace scale_color_brewer() with scale_fill_brewer().

    qplot(animals, value, data = data, fill=animals)+ 
      geom_boxplot() + facet_grid(~region) + scale_fill_brewer()
    

    enter image description here

    0 讨论(0)
提交回复
热议问题