You can adjust the spacing below and above the plotted data by adjusting the first and second values in expand = expansion(mult = c(0.05,0.1))
. By adjusting that and the textsize
argument, you can make the display of the p values pretty. I believe 0.05 is the default value for both bottom and top spacing.
Setting fill = Groups
colors the interior of the boxes.
Adding theme_bw()
sets a white background.
ggplot(DFlng, aes(x = Groups, y = value, fill = Groups)) + geom_boxplot() +
facet_wrap(~Param, scales = "free_y") +
geom_signif(comparisons = list(c("Control", "Treatment"),
c("Control", "Treatment"),
c("Control", "Treatment"),
c("Control", "Treatment"),
c("Control", "Treatment")),
test = "t.test", textsize = 3) +
scale_y_continuous(expand = expansion(mult = c(0.05,0.1))) +
theme_bw()