1

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

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

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))

在此处输入图像描述

4

1 回答 1

1

这可以接受吗?

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")

在此处输入图像描述

于 2017-09-21T14:27:36.697 回答