如何将此统计摘要图中的低点和高点更改为25%四分位数和75%四分位数?
ggplot(data = diamonds) + stat_summary(
mapping = aes(x = cut, y = depth),
fun.ymin = min,
fun.ymax = max,
fun.y = median
)
答案 0 :(得分:5)
ggplot(data = diamonds) + stat_summary(
mapping = aes(x = cut, y = depth),
fun.ymin = function(z) { quantile(z,0.25) },
fun.ymax = function(z) { quantile(z,0.75) },
fun.y = median)
答案 1 :(得分:3)