I am using ggplot2 in R to make plots like the following ones:
The errorbars overlap with each other which look really messy. How can I separate the errorbars for different indices? I have used position="dodge" but it seems to be not working. Here is the main part of my code:
plot = ggplot(data,aes(x=ntrunc,y=beta_best,group=ntrunc,colour=INDEX))
+geom_point(aes(shape=detectable),na.rm=TRUE,position="dodge")
+geom_errorbar(aes(x=ntrunc,ymax=beta_high,ymin=beta_low),na.rm=TRUE,position="dodge")
position = position_dodge(width = 0.90)
. See also this post. $\endgroup$ntrunc
? Shouldn'tgroup
beINDEX
? $\endgroup$