Set number of columns (or rows) in a facetted plot

前端 未结 1 759
Happy的楠姐
Happy的楠姐 2020-12-03 05:08

I have a facetted plot like this:

ggplot(mtcars, aes(x = hp, y = mpg)) +
  geom_point() +
  facet_grid(. ~ carb)

However, the graph is too

相关标签:
1条回答
  • 2020-12-03 05:27

    You can use the ncol (or nrow) argument in facet_wrap:

    ggplot(mtcars, aes(x = hp, y = mpg)) +
     geom_point()  +
     facet_wrap(~ carb, ncol = 3)
    

    0 讨论(0)
提交回复
热议问题