I would like to draw boxplots of relationship between a continuous and a categorical variables (geom_boxplot
with ggplot2
), this for several situations (facet_wrap
). Quite easy:
data("CO2")
ggplot(CO2, aes(Treatment, uptake) ) +
geom_boxplot(aes(Treatment, uptake),
col="black", fill="white", alpha=0, width=.5) +
geom_point(col="black", size=1.2) +
facet_wrap(~Type, ncol=3, nrow=6, scales= "free_y") +
theme_bw() +
ylab("Uptake")
This is quite nice with this toy dataset, but applied to my own data (where facet_wrap enables me to plot 18 different graphs) the y-axes are hardly readable, with varying number of y-ticks and varying spacing between them:
What could be a nice way to harmonize the y-axes? (i.e., getting equal spacing between y-axes ticks, no matter what breaks are -these will necessarily change from a graph to another because the variation range of my continuous variable changes a lot)
Thank you very much for any help :)