0

I created a graph (see photo plot with facet grid) with the following code:

ggplot(data_maxqda2, aes(Codesystem, farmers_all_clusf1, fill=grouping)) + 
geom_bar(stat = 'identity') +
xlab("Agriculture")+
ylab("Frequency")+
coord_flip()+
facet_grid(grouping~ ., scales = "free", space = "free",switch = "y") +
theme(strip.text.y = element_text(angle = 90), strip.background = element_rect("grey"), strip.placement = "outside")

Now I would like that the y label (in the example it's the x-lable because of the flip so "Agriculture") spans all grouping categories. So I would like to have a strip that is parallel to the two other grey strips and as long as the two strips with "low" and high" (with the photo it's easier to unterstand.

I found this post Combine multiple facet strips across columns in ggplot2 facet_wrap but unfortunately I am not advanced enough to understand it.

Thanks a lot for your help!

Manu97
  • 15
  • 3
  • Might `facet_grid` do what you need? It allows you to facet over multiple variables. https://ggplot2.tidyverse.org/reference/facet_grid.html – geoff Jan 21 '22 at 11:38

0 Answers0