如何让 ggplot 直方图 bin 跟随箱线图中断
到目前为止我有这个:
hist <- ggplot(Mydf, aes(x=Mydf$Avg.CPC))
breaks <- c(min(Mydf$Avg.CPC), median(Mydf$Avg.CPC), max(Mydf$Avg.CPC))
h <- hist + geom_bar(binwidth = 0.025, colour = "black", breaks = breaks)
print(h)
我收到一个错误。它不喜欢有不同的宽度。我还希望在进行此操作时将 Q1 和 Q3 四分位数作为休息时间。那不可能吗?我认为这被称为小提琴情节。谢谢
So far I have this:
hist <- ggplot(Mydf, aes(x=Mydf$Avg.CPC))
breaks <- c(min(Mydf$Avg.CPC), median(Mydf$Avg.CPC), max(Mydf$Avg.CPC))
h <- hist + geom_bar(binwidth = 0.025, colour = "black", breaks = breaks)
print(h)
I get an error. It doesn't like having different widths. I would also like to have the Q1 and Q3 quartiles as breaks while I am at it. Is that not possible? I think it is called a violin plot. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您要找的吗?
is this what you are looking for?