Removing NS from ggplot

Hello, newbie here! I am trying to create a boxplot with multiple comparisons (repeated measures). When using the function hide.ns = True in the stat_pvalue_manual function, I am able to hide the non-significant (ns) values but a big gap is left in between the significant values. Does anyone know a way to remove these non significant values (ns) or hide them in a way that does not leave a big gap in between values?

Thank you in advance!

##pairwise comparison
pwc <- df %>%
y ~ x, paired = TRUE,
p.adjust.method = "none"

print(pwc, n = nrow(pwc))

p <- ggplot(df, aes(x, y, color=x, add = "jitter")) + geom_boxplot() +
theme_classic() + labs(x = "Period", y = "Pain Pressure Threshold (kg)", color = "Condition") +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5))

##adding stats
p <- p +
stat_pvalue_manual(pwc, tip.length = 0.01, hide.ns = TRUE)
subtitle = get_test_label(res.aov, detailed = TRUE),
caption = get_pwc_label(pwc)


To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.