ggplot2 fill color from data values

后端 未结 1 1353
陌清茗
陌清茗 2021-01-19 05:21

I want to be able to set the ggplot fill color from values stored in the data frame. The following code is \'almost\' what I am trying to do, except that instead of just usi

1条回答
  •  渐次进展
    2021-01-19 05:53

    ggplot(df, aes(Animals, Number, fill=Animals)) + geom_bar(stat='identity') +
      scale_fill_manual(values = df$MyColor)
    

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