Closed guilhermeparreira closed 3 years ago
Hey Guilherme,
sorry for the delay. I did try to figure out yesterday what is happening there, but got very confused by my own code and the way that ggplot calls the internal functions. It's been a while since I wrote the original code. I will give it another try next week.
Best, Constantin
Has there been any progress on this issue?
Here is an example using both x
and fill
, where the square brackets do appear.
library(ggsignif)
library(ggplot2)
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.05
) +
geom_signif(
comparisons = list(c("S1", "S2")),
y_position = 9.3, tip_length = 0.05, vjust = 0.2
) +
scale_fill_manual(values = c("grey80", "grey20"))
Created on 2021-08-12 by the reprex package (v2.0.1)
I am not sure what this is supposed to do in your example. It's likely to be the source of the issue you are facing.
aes(x=x,xend=xend, y=y, yend=y, annotation=annotation),
Hi There. Thanks for your package! Inspiring!
When I have a graphic using
x
andfill
argumentstip_length
does not work properly. See the code below:Produces:
So, it does not produce square brackets for the first
geom_signif
. Maybe it is due to the fact that it uses data.frame. But I don't know how to solve.It would be great if you could have a look on it.
Thanks in advance!