在 ggpubr 中躲避标签

Dodging labels in ggpubr

我正在尝试创建一个交互条形图,在每个条形图上方放置平均分隔字母。我无法弄清楚如何定位标签以避开它们。任何帮助将不胜感激。

这里我使用的是基于牙齿生长数据集的数据:

df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3),
              dose=rep(c("D0.5", "D1", "D2"),2),
              len=c(6.8, 15, 33, 4.2, 10, 29.5))
ggbarplot(df2, "dose", "len",color="supp",fill="supp", 
       label = c("bc","c","a","a","ab","bc"), position = position_dodge(.8))

这可以接受吗?

df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3),
                  dose=rep(c("D0.5", "D1", "D2"),2),
                  len=c(6.8, 15, 33, 4.2, 10, 29.5),
                  label = c("bc","c","a","a","ab","bc"))

 ggbarplot(df2, "dose", "len",color="supp",fill="supp", label = "label",
               position = position_dodge(0.8), lab.col = "supp")