This is a follow-on from this question, in which I was trying to suppress the vertical gridlines.
The solution, as provided by learnr, was to add scale_x_continuous(brea
As code in comments does not display nicely, so I am posting this as an answer. You could do something like this and add labels manually with geom_text()
:
ggplot(data, aes(x, y)) +
geom_bar(stat = 'identity') +
scale_x_continuous(breaks = NA) +
opts(
panel.grid.major = theme_line(size = 0.5, colour = '#1391FF'),
panel.grid.minor = theme_blank(),
panel.background = theme_blank(),
axis.ticks = theme_blank()
)+
geom_text(aes(label = x, y = -.3))