0

I'm attempting to show a bar graph for some ANOVA data, and I've done so with GGPlot2. The error bars are showing up fine, but there are no bars to be seen no matter what I try.

This is the code I've tried:

ggplot(data = mydata, aes(x = StressCond, y = StressScore))+
  geom_bar(stat = "summary", fun = mean, aes(fill = CRGroup), position = "dodge")+
  geom_errorbar(stat = "summary", fun.data = mean_se, width = 0.25, 
                aes(group = CRGroup), position = position_dodge(0.9))

I'm expecting something like this:

expected

But I'm getting this:

result

Z.Lin
  • 28,055
  • 6
  • 54
  • 94
  • The example is not reproducible. Can you perhaps share the results if you run just the first two lines, i.e., without geom_errorbar()? – TheN Apr 16 '23 at 06:57
  • 1
    Welcome to SO! Your code looks fine and should give you the desired result. For more help we need [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data so that we can reproduce your issue. – stefan Apr 16 '23 at 09:27

0 Answers0