I've seen several answers on how to change the order of facets by reordering the factor levels. But I would like to change the order in which the margin is presented. So basically have (all)
displayed on the left panel before 4
, 6
, 8
. Thanks in advance!
library(ggplot2)
qplot(mpg, wt, data=mtcars) + facet_grid(. ~ cyl, margins=TRUE)
How about
mtcars2 <- rbind(mtcars, within(mtcars, cyl <- "(All)"))
qplot(mpg, wt, data = mtcars2) + facet_grid(. ~ cyl)