0
在Minitab中,很容易创建“分割点”直方图。这可以在ggplot2
完成吗?ggplot2中的分界点直方图
例如,
df <- data.frame(x = c(0.08, 0.21, 0.25, 0.4, 0.5, 0.6))
ggplot(df, aes(x = x)) + geom_histogram(binwidth = 0.1)
正如你可以在这里看到,R
默认为 “中点” 直方图。包含0.08
的酒吧在0.1
处标有酒吧。包含0.21
和0.25
的栏正在标记为0.2
等等。
我可以以某种方式改变这些酒吧因此第一条涵盖0
和0.1
之间的区域,而第二条涵盖0.2
和0.3
,等等之间的区域?
不知道你想要输出什么,但这样做吗? 'ggplot(df,aes(x = x))+ geom_histogram(breaks = seq(0,max(df $ x),by = 0.1))' –
边界参数也应该在这里: 'ggplot(df,aes (x = x))+ geom_histogram(binwidth = 0.2,boundary = 1)' – pHroc