I have the following code in R using the ggplot2 package to create a stacked bar plot.
ggplot(example_data, aes(x = ID, y = amount, fill = Taxa)) +
geom_bar(stat="identity", position = "fill") +
facet_grid(.~City+Car+Color , scales = "free_x", space = "free_x") +
labs(y = "Relative Adbundance")+
theme(axis.title.x = element_blank(),
axis.ticks = element_blank(),
axis.text.x = element_blank(),
legend.position = "none")
Is there a way to simply combine parts of different facets? The picture below explains what I mean. I want one gray bar saying "Milan" for all 5 facets that currently say Milan. I do not want to repeat the word "Milan" five times. Same for all the other circled groups. Is this possible in ggplot2? If not, does anyone know a work around?