With the following code I can create the chart underneath:
library(ggplot2)
ds <- as.data.frame(mtcars)
ds$gear <- as.factor(ds$gear)
ds$carb <- as.factor(ds$carb)
d1 <- ds[ds$carb %in% c("1","2","3"),]
ggplot(d1, aes(fill=gear, x=carb)) +
coord_flip() +
geom_bar(position=position_fill(reverse=TRUE), width=0.7)
How can I now create an additional bar on top, which gives me the summary-plot of the three groups? It should ideally be in the same plot and not in a separate one