I have a simple bargraph like the following
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))
ggplot(a,aes(x,y)) +
geom_bar(stat="identity",fill="orange",width=0.4) +
coord_flip() +
theme_bw()
Now , because the levels of the x axis (flipped and now seems like y ) have a relation with each other e.g male and female represent sex breakdown , working and not working represent another breakdown etc., I want the axis to leave some space between each breakdown in order to point out these breakdowns.
I have tried some things with scale_x_discrete
and its parameter break but it seems that this is not the way it goes .
Any ideas ?