r - 为什么 geom_errorbar 只在我的情节中间给我一些小线条
问题描述
使用 geom_errorbar 时出现问题。我得到的只是中间的小线,而不是整个范围?!
gd <- data_long %>%
group_by(ISItime, FIRST_cat) %>%
summarise(mean_ISI= mean(ISIscore, na.rm = TRUE),
sd_ISI= sd(ISIscore, na.rm = TRUE))
gd<- gd %>%
mutate(ymax = mean_ISI + sd_ISI, ymin = mean_ISI - sd_ISI)
ggplot(gd, aes(x = ISItime, y = mean_ISI, group= FIRST_cat, color= FIRST_cat)) +
geom_line (alpha= 0.9, size = 2) + theme_bw() +
geom_line()+
geom_errorbar( aes(x=ISItime, ymin=mean_ISI-sd_ISI, ymax=mean_ISI+sd_ISI), width=0.6,
colour="orange", alpha=0.9, size=.3, position=position_dodge(.3))+
ylim(c(2,12))+ labs(x="Month", y="Mean ISI Score") +
scale_x_discrete(labels=c("Pre-Study ISI","T0","T1","T2","T3",
"T4","T5","T6","T7","T8","T9",
"T10","T11","T12")) +
labs(x = "Timepoint")
如果有人可以提供帮助,我将不胜感激。我对自己做错了什么以及为什么我没有得到正确的错误栏感到很困惑。谢谢。
解决方案
推荐阅读
- django - Django 表单已清理
- c# - 国家/地区的 Google Places API 查询自动完成限制不起作用
- django - 即使没有实际的新迁移,Django 迁移命令也会挂在 Heroku 上
- controller - 子文件夹中的codeigniter4控制器路由
- file - 在 Katalon 中使用 POST API 上传文件
- python - 嵌套列表元素与新列表匹配,如果列表包含相同的添加 - python
- javascript - 将具有特殊字符的数组转换为字符串
- node.js - 每当我尝试发送多个请求以将数据写入 Firebase(angular8/node.js)时,UI 就会冻结
- python - Altair 分层图表:如何总结图表?
- mongodb - 从 Spring Boot 应用程序将数据转储到 Mongo 集合