const-ae/ggsignif

Move labels below lines

telpewen opened this issue · 1 comments

Is there a way to put the label below the line? I'm working on a graph with negative values, so the bars are above the annotation, and I'd like the line to be above the annotation as well (thus, the line would fall between the bar and the annotation).

Hi, I think the easiest way is to use the vjust argument like this:

library(tidyverse)

tibble(y = rnorm(100, mean = -5),
       group = rep(LETTERS[1:4], each = 25)) %>%
  ggplot(aes(x= group, y=y)) +
  geom_boxplot() +
  ggsignif::geom_signif(comparisons = list(c("A", "B")), y_position = -7.5, 
                        tip_length = 0, vjust=2)

Created on 2019-03-14 by the reprex package (v0.2.1)

I will close the issue for now, but if this is not resolving your problem or if I misunderstood something, feel free to comment below.