我想喂我的直方图bin的数量geom_histogram
,而不是通过binwidth
控制bin的数量。 The documentation说我可以通过设置bins
参数来做到这一点。但是当我运行时直接在ggplot中设置直方图的bin数
ggplot(data = iris, aes(x = Sepal.Length)) + stat_bin(bins = 5)
我得到一个带有30个bin的输出消息,就像我没有指定binwidth一样。
stat_bin:binwidth默认为范围/ 30。使用'binwidth = x'来调整它。
我试过把这个参数提供给stat_bin
和qplot
带有同样的问题。难道我做错了什么?
我正在使用ggplot2版本1.0.1。
你可以分享你的资料,请 – mtoto
您正在使用什么版本ggplot的? – Heroka
@mtoto我改变了问题,所以它使用通用数据 – Empiromancer