ggpubr / ggbarplot中的错误栏突然合并(没有代码更改),如何再次将它们分开?

时间:2018-09-12 09:19:21

标签: r ggplot2 ggpubr

我有以下代码:

ggbarplot(Text1, x = "Page", y = "IA_REGRESSION_OUT_COUNT", 
          color = "Modified", add = "mean_se", fill = "Modified", 
          width = .6, position = position_dodge(0.8)) +  
  stat_compare_means(method = "t.test", aes(group = Modified), 
                     label = "p.signif", label.y = 0.3, na.rm = TRUE) + 
  labs(x = "Page number", y = "Avg Regression Count", 
       caption = "* = p value < 0.5; **** = p value < 0.0001") + 
  scale_color_manual(values=c("black", "black")) + 
  scale_fill_manual(values=c("#CCCCCC","#FFFFFF")) + 
  theme_minimal()

产生了这个情节

Before

但是,从今天开始,这可能是因为某些更新?

After

有什么主意要解决此问题,并在每列的错误栏中将其恢复吗?

2 个答案:

答案 0 :(得分:1)

此问题现已修复。请在GitHub(https://github.com/kassambara/ggpubr/issues/109)上安装最新的开发版本,然后尝试以下操作:

library(ggpubr)
ggbarplot(ToothGrowth, x = "dose", y = "len", 
   add = "mean_se", 
   color = "supp", palette = "jco",
   position = position_dodge(0.8)
)

生成的图应如下所示:

enter image description here

答案 1 :(得分:1)

我找到了解决方案。只需添加关注代码即可。

add.params = list(group = "type"), position = position_dodge(0.8)