I am having a bit of a hard time getting my histogram to plot the correct number of bins. I would like each bin to be the values 1-5, 5-10, 10-15, etc but when I use stat_bin it reverts to the range/30 default.
ggplot(tmp,aes(x = values)) +
+ facet_wrap(~ind) +
+ geom_histogram(aes(y=..count../sum(..count..)),stat="bin")+
+ scale_x_continuous("Percent above 30x")+
+ scale_y_continuous("Fraction of panel")+
+ opts(title = yz)+
+ stat_bin(bandwidth=5.0)
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.
I was thinking it would likely be some silly syntax thing that I did not quite grasp while I was reading.
I was hoping someone could advise me on why this is happening.
The OP posted this solution: add
binwidth=5argument togeom.