I would like to make two changes to the following chart
Leaveasmallspacebetweenthegreen(F)boxplotandorange(s)
Placethemedianpointinthecenterofeachboxplot(pointsareappearingattheendoftheboxplotandwhenthetwoplotshavethesamemedianvalue,onlyonepointisplotted).
/li>DoesanyoneknowwhatchangesIshouldmakeinmyscript?
Myspreadsheetcanbeaccessedthroughthelink: link
Thanks in advance for any help, I'll leave the sampling below:
library(ggplot2)
head(dados)
dados$warfare <- factor(dados$warfare, levels=c("war1", "war2", "Post"))
ggplot(dados, aes(x=warfare, y=Abund, group=warfare:habitat_F_S, colour = as.factor(habitat_F_S), fill=habitat_F_S)) +
geom_boxplot(outlier.shape = NA) +
scale_fill_brewer(palette="Dark2") +
scale_colour_brewer(palette="Dark2") +
stat_summary(fun.y=median, geom="line", lwd=1, aes(group=habitat_F_S, colour=habitat_F_S)) +
stat_summary(fun.y=median, colour="black", geom="point", shape=18, size=1,show_guide = FALSE, aes(group=habitat_F_S, colour=habitat_F_S)) +
facet_wrap(~ specie, nrow=5) +
labs(x="time", y="Abund", colour="Habitat", fill="Habitat") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))