I make a bargraph in ggplot2, and to explain the reasons I need spaces between some of my bars. I use the limits in scale_x_discrete to insert empty bars, which gives me the gap I need.
The gap between groups b and c in my layout data looks perfect, but the gap between a and b still has a black mark and a white line in the background. I don't need any x-axis grid lines, so I can solve the white line problem quite easily, but I cannot decide how to get rid of the label.
I am using R version 3.3.1 (2016-06-21) - "Error in your hair" while working in RStudio, and this code requires ggplot2
### Mock data with the same structure as mine my.data <- data.frame(x = rep(c("a", "b", "c", "d"), 3), y = c("e", "f", "g")) ### Make graph ggplot(my.data, aes(x = x, fill = y)) + geom_bar(position = "fill") + scale_x_discrete(limits = c("a", "", "b", "", "c", "d")) ### Remove white line in background by removing all x grid lines ggplot (my.data, aes(x = x, fill = y)) + geom_bar(position = "fill") + scale_x_discrete(limits = c("a", "", "b", "", "c", "d")) + theme(panel.grid.minor.x = element_blank(), panel.grid.major.x = element_blank())
How to remove a black mark between a and b ?
If I need to change the way I insert spaces between columns, how can I do this and maintain the chart structure?
