2

I was wondering, is there a way to make facet_wraps() labels cover all of the related columns in ggplot. Here is a example to show what I mean:

library(tidyverse)

p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
p + facet_wrap(~ vs+cyl, labeller = label_value)

As you can see, in the previous plot, the labels 0 and 1 are present above all of the columns, separately. I would like to modify it in a way that there is only one 0 above the first row of columns and only one 1 over the second row of columns.

stat_stud
  • 107
  • 4
  • 1
    There doesn't seem to be an easy solution, but the possibilities are covered in this post: [How to position strip labels in facet\_wrap like in facet\_grid](https://stackoverflow.com/questions/52706599/how-to-position-strip-labels-in-facet-wrap-like-in-facet-grid) – caldwellst Apr 29 '20 at 12:20
  • 5
    check out @teunbrand 's `ggh4x::facet_nested` in the https://github.com/teunbrand/ggh4x – tjebo Apr 29 '20 at 12:25
  • 2
    Some great functionality in that package, thanks @Tjebo. – caldwellst Apr 29 '20 at 12:50

0 Answers0