0
library(ggplot2)
library(Hmisc)
data(mtcars)
myplot <- ggplot(mtcars, aes(x = as.factor(cyl), y = qsec)) +
geom_boxplot() +
stat_summary(fun.y = mean, geom = "point", shape = 5, size = 2) +
stat_summary(fun.data = mean_cl_normal, geom = "errorbar",
width = 0.2)
我想躲閃的均值和誤差條有點權,使得誤差線不掩蓋IQR線的boxplot。指定position=position_dodge(.5)
似乎不起作用,因爲geom_errorbar
不知道geom_boxplot
。
這是一個整潔的想法,並解決了我的問題。謝謝! – coanil 2014-10-09 14:54:28