我有两个数据帧,第一个:
第二个:
我使用第一个数据帧创建了如下所示的条形图.
虽然我没有使用每个一致性组中的se值在它上面放置错误条.
以下是我的代码:
ggplot(AAData_cong, aes(x=Congruency, y=joystick_reaction, fill = as.factor(Congruency)))+
geom_bar(position=position_dodge(.5), size=.75, width=0.5, colour="black", stat= "summary", fun= "mean") +
geom_line(aes(group=participant), linetype = "dashed") +
geom_point(aes(group=participant), shape = 21, color = 'black')+
# geom_errorbar(aes(ymin=RT_Cong$joystick_reaction-RT_Cong$se, ymax=RT_Cong$joystick_reaction+RT_Cong$se), width=.2,
# position=position_dodge(0.05))+
theme_classic(base_size=18)+
coord_cartesian(ylim = c(700, 1200))+ # set the y limits
ylab("RT (ms)")+labs(fill="j")+
theme(axis.title.y = element_text(size = rel(1), angle = 90, vjust=1.25))+
theme(axis.title.x = element_text(size = rel(1), angle = 0, vjust=0))+
theme(axis.text.x = element_text(size=rel(1)))+
theme(axis.text.y = element_text(size=rel(1)))+theme(legend.position = "none")+
theme(strip.text.x = element_text(size=9))+
# from set 1 color brewer
scale_fill_manual(values=c("#0571b0","#ca0020"))
提前谢谢您!