library(ggplot2)
library(gridExtra)
grid.arrange(
p1 <- ggplot(mpg, aes(class, hwy)) + geom_boxplot(),
p2 <- ggplot(mpg, aes(class, hwy)) + geom_boxplot(aes(weight=displ))
)
cbind(ggplot_build(p1)$data[[1]][,"middle"], ggplot_build(p2)$data[[1]][,"middle"])
I did not find anything on how the
weightaesthetic ingeom_boxplot/stat_boxplotis working. Is it missing? Or did I look at the wrong place?