ggplot2: remove colour and draw borders in bar plot

后端 未结 2 334
甜味超标
甜味超标 2021-01-13 23:59

I am currently using ggplot2 to plot a barchart with too many levels in fill. As a result, I am unable tell when a bar ends and the other begin.

Here\'s my sample da

相关标签:
2条回答
  • 2021-01-14 00:30
    p <- ggplot(aes(variable, Length.1), data = data)+ geom_bar(stat="identity",colour="black", fill="white")+geom_text(...)
    
    0 讨论(0)
  • 2021-01-14 00:42

    I would use the ggplot function instead of qplot. Then you can set the color and fill manually:

    ggplot(data,aes(x=variable, y=Length.1,group=value))+
      geom_bar(fill="white",color="black")+
      geom_text(aes(label = Length.1), size = 3, hjust = 0.5, vjust = 3, position ="stack") +
      theme_bw()
    
    0 讨论(0)
提交回复
热议问题