I'm looking at figures from Moreira et al. (Nature, 2020) where they have graphs indicating sample size and treatments under the barplots such as this:
Is there a way to reproduce this in ggplot? This would be very useful to indicate all the necessary information regarding an experiment in a compact manner.
Some dummy data for the plot:
library(tidyverse)
tibble(
Rodent = c(rep("Mouse",11),
rep("Hamster",7),
rep("Guinea pig",4),
rep("Gerbil",12)),
`Weight (gm)` = rnorm(34,25,10),
`Long whiskers` = c(rep("+",11),rep("-",7),rep("+",4),rep("-",12)),
`Long tail` = c(rep("+",11),rep("-",7),rep("+",4),rep("-",12)),
`Albino or normal` = c(rep("Albino",11),rep("Normal",7),rep("Albino",4),rep("Normal",12))
) %>%
ggplot(aes(Rodent,`Weight (gm)`,fill = `Albino or normal`)) +
geom_boxplot()


