This question has been asked before but the answers aren't always clear or are complicated. I'm hoping that newer versions of ggplot2 have lead to easier solutions.
How can you eliminate just the vertical lines of a ggplot without eliminating the axis tick marks or labels? This would really be nice for bar graphs as it would eliminate some unnecessary distraction from the graphic.
Here is some sample code to aid the discussion:
library(ggplot2)
set.seed(10)
CO3 <- data.frame(id=1:nrow(CO2), CO2[, 2:3],
outcome=factor(sample(c('none', 'some', 'lots', 'tons'),
nrow(CO2), rep=T), levels=c('none', 'some', 'lots', 'tons')))
CO3
x <- ggplot(CO3, aes(x=outcome)) + geom_bar(aes(x=outcome))+
facet_grid(Treatment~Type, margins='Treatment', scales='free')
x + theme_bw() + opts(axis.text.x=theme_text(angle= 45, vjust=1, hjust= 1))
Try this, redifining guide_grid.
This solution is from the Cookbook for R