我有点难以让我的直方图绘制正确数量的垃圾箱。我希望每个bin都是值1-5,5-10,10-15等,但是当我使用stat_bin时,它将恢复为范围/ 30默认值。stat_bin恢复为默认
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.
我在想这可能是一些愚蠢的语法的东西,我没有很好地掌握,而我正在阅读。 我希望有人可以告诉我为什么会发生这种情况。
请不要在您的问题中添加答案。我将删除您的答案并将其作为答案发布。 – Andrie 2012-08-16 17:49:43