I would like to divide my x axis into two groups. I managed already to make one group using facet but can't make a second one. Here is a picture of what I already have and what I want additionally. Here is also my command:
ggplot(myk.p, aes(x=Group, y=Colonization, fill=MO)) +
geom_bar(stat="identity", colour="black") +
scale_fill_manual(values=c("#000000","#7a7a7a","#c0c0c0")) +
theme(panel.margin = unit(0, "lines"), strip.background =
element_blank()) + facet_wrap(~Water, switch = "x", scales = "free_x") +
ggtitle("Root mycorrhization in % (Populus nigra)")
Example Data.csv:
"Group" "Colonization" "MO" "Water" "Fertilizer"
"P1" 69,2307692308 "C" "once" "without"
"P2" 71,8232044199 "F" "once" "without"
"P3" 82,5174825175 "I" "once" "without"
"P4" 66,4122137405 "C" "once" "with"
"P5" 86,013986014 "F" "once" "with"
"P6" 98,7654320988 "I" "once" "with"
"P7" 41,9540229885 "C" "twice" "without"
"P8" 65,7894736842 "F" "twice" "without"
"P9" 63,9705882353 "I" "twice" "without"
"P10" 62,5850340136 "C" "twice" "with"
"P11" 87,012987013 "F" "twice" "with"
"P12" 89,696969697 "I" "twice" "with"