【发布时间】:2014-05-20 19:42:32
【问题描述】:
我想出了如何从 ggplot 中获取每个 bin 的计数,有人知道如何在绘图上显示这些数字吗?
g <- ggplot()+geom_histogram()
ggplot_build(g)$data[[1]]$count
【问题讨论】:
-
使用
stat_bin和geom_text。 -
欢迎来到 StackOverflow!请阅读有关如何ask a question 以及如何生成minimal reproducible example 的信息