简体   繁体   English

ggplot2:更改CI的显示方式,与“ mean_cl_boot”中的均值无关

[英]ggplot2: Change appearence of CI independent from mean in “mean_cl_boot”

Using stat_summary(fun.data = "mean_cl_boot") I want to make the line of the CI thicker, but keep the point (mean) small to keep small CIs visible. 我想使用stat_summary(fun.data = "mean_cl_boot")使CI的线变粗,但要使该点(平均值)较小以使小的CI可见。
Changing the size parameter affects the point and the line simultaneously. 更改大小参数会同时影响点和线。

Minimal example from the doc: 文档中的最小示例:

d <- ggplot(mtcars, aes(cyl, mpg)) + geom_point()
d + stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 2)

You have to specify another geom and add the stat_summary twice 你必须指定其他geom ,并添加stat_summary两次

d + stat_summary(fun.data = "mean_cl_boot", colour = "red", 
                 size = 2, geom = "linerange") + 
    stat_summary(fun.data = "mean_cl_boot", colour = "blue", 
                 size = 1.8, geom = "point", shape = 4)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM