I am trying to use ggsignif
for displaying significant stars in top of paired bar graphs using facet_wrap. However, I can′t manage to find a way of displaying one significant bar per facet. Here is what I mean:
dat <- data.frame(Group = c("S1", "S1", "S2", "S2"),
Sub = c("A", "B", "A", "B"),
Value = c(3,5,7,8))
ggplot(dat, aes(Group, Value)) +
geom_bar(aes(fill = Sub), stat="identity", position="dodge", width=.5) +
geom_signif(y_position=c(5.3, 8.3), xmin=c(0.8, 1.8), xmax=c(1.2, 2.2),
annotation=c("**", "NS"), tip_length=0) +
scale_fill_manual(values = c("grey80", "grey20")) +
facet_grid(~ Group, scales = "free")
Is there a way of making sure that each facet has its individual significance label?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…