Closed teunbrand closed 3 years ago
This should now be possible:
library(ggh4x)
#> Loading required package: ggplot2
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
facet_nested_wrap(vars(cyl, drv))
Created on 2020-08-12 by the reprex package (v0.3.0)
Basically the strip merging of
facet_nested()
but then in a facet wrap layout. Should be doable to adapt/clone + adapt the strip merging logic fromfacet_nested()
to do the same to wrapped facets. Probably have to constrain the merging to panel rows/columns somehow. A limitation would be that when grouped panels are placed in seperate rows/column, there is no elegant merging of strips to be done.There seems to be some demand for it:
https://stackoverflow.com/questions/62652308/combine-multiple-facet-strips-across-columns-in-ggplot2-facet-wrap
https://github.com/teunbrand/ggnomics/issues/5