I have a simple bargraph like the following
a<-data.frame(x=c(\"total\",\"male\",\"female\",\"low education\",
\"mid education\",\"high educ
a<-data.frame(x=c("total","male","female","low education","mid education","high education","working","not working"),y=c(80,30,50,20,40,20,65,35))
a$x<-as.character(a$x)
a$x<-factor(a$x,levels=unique(a$x))
a$rel = c("a", "a", "a", "b", "b", "b", "c", "c") # set groups
ggplot(a, aes(rel, y, fill = factor(x))) +
geom_bar(stat = "identity", width = 0.5, position = position_dodge(0.7))