I'm trying to plot a histogram using ggplot which has some space between the bars.
This is no problem with discrete data:
b= data.frame(x=sample(LETTERS[1:3],size=50, replace=T))
ggplot(b, aes(x=x)) + geom_bar(width=.3)
However, using continuous data, width
seems to have no effect.
a= data.frame(x=rnorm(100))
ggplot(a, aes(x=x, width=.5)) +
geom_bar(width=.3, binwidth=1)
How can a histogram with spaced bars be archived for continuous data?