Set number of columns (or rows) in a facetted plot
Question
I have a facetted plot like this:
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point() +
facet_grid(. ~ carb)
However, the graph is too wide to be clearly read.
I'd like to be able to take the three rightmost locations and place them under the three leftmost, i.e. the facets should be in three columns * two rows like this.
1 2 3 4 5 6
Is it possible to set the layout of the facets, i.e. to set number of columns (or rows) with facet_grid()
?
The documentation on facet_grid doesn't seem to indicate that it's possible.
Thanks for the help :-)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow