我想绘制连续变量和分类变量(geom_boxplotwith ggplot2)之间关系的箱线图,这适用于几种情况(facet_wrap)。很简单:
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")
Run Code Online (Sandbox Code Playgroud)
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 …