Remove space between bars ggplot2

前端 未结 2 1456
天涯浪人
天涯浪人 2020-12-02 00:19

This is my code

    ggplot(df, aes(x=timepoint, y=mean, fill=group)) +
            geom_bar(position=position_dodge(.3), colour=\"black\", stat=\"identity\",         


        
2条回答
  •  温柔的废话
    2020-12-02 00:40

    Just adjust the widths:

    ggplot(df, aes(x=timepoint, y=mean, fill=group)) +
      geom_bar(position=position_dodge(0.9), colour="black", stat="identity", width=0.9, , binwidth=0) +
      geom_errorbar(position=position_dodge(0.9), width=0.85, aes(ymin=mean, ymax=mean+sem)) +
      theme_bw() 
    

    enter image description here

提交回复
热议问题