【发布时间】:2022-08-12 16:53:24
【问题描述】:
我想按主题绘制数据,但添加总均值和 se 的误差条。我的意思是,不是每个主题的错误栏。我尝试过 geom_errorbar 和 stat_summary 但仍然未能得到我理想的情节(见我画的图)。
这是我用来绘制此图的代码(错误栏是手动添加的)。
ggplot(ASD, aes(x=period, y=meanF0, group=subject, color=group)) +
geom_line(aes(color=group, size=group)) +
scale_size_manual(values=c(.6, .6, .6, .6)) +
theme_light()+
xlab(\"Period\")+
ylab(\"F0 (Hz)\")+
ggtitle(\"Mean F0 Adjustment (ASD Group)\") +
geom_point()+
scale_color_manual(values=c(\"red\")) +
theme(plot.title = element_text(size=14.5, face=\"bold\", hjust = 0.5, family = \"serif\"),
axis.title.y= element_text(size=12, face = \"bold\", family = \"serif\"),
axis.title.x= element_text(size=12, face = \"bold\", family = \"serif\"),
axis.text.x = element_text(size=11, face=\"bold\", family = \"serif\"),
axis.text.y = element_text(size=11, face=\"bold\", family = \"serif\"))+
theme(legend.position = \"none\")+
geom_hline(yintercept=112.8, linetype=\"dashed\",
color = \"dark grey\", size=.7)
任何人都可以帮忙吗?非常感谢!!!
-
看起来您对 SO 很陌生;欢迎来到社区!如果您想快速获得很好的答案,最好让您的问题可重现。这包括示例数据,例如来自
dput(head(dataObject)))的输出以及您正在使用的任何库(尽管在这种情况下,它似乎很可能只是ggplot2)。看看:making R reproducible questions。