【发布时间】:2012-08-16 17:36:42
【问题描述】:
我很难让我的直方图绘制正确的 bin 数量。我希望每个 bin 的值都是 1-5、5-10、10-15 等,但是当我使用 stat_bin 时,它会恢复为 range/30 默认值。
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.
我在想这可能是一些我在阅读时没有完全掌握的愚蠢语法。 我希望有人能告诉我为什么会这样。
【问题讨论】:
-
请不要在您的问题中添加答案。我将删除您的答案并将其作为答案发布。