I have this table:
a b c d
A 55 2 0.07
A 123 1 0.05
B 222 2 0.04
B 234 1 0.03
C 233 2 0.03
C 187 1 0.04
D 564 2 0.06
D 325 1 0.01
E 112 2 0.02
E 105 1 0.01
I'm plotting a barplot with dots using geom_bar
and geom_point
. For some reason, the dots are not centered in the middle of the bar. Can somebody help with this?
My code:
ggplot(table, aes(x=a, y=d, fill=as.factor(c))) +
geom_bar(stat="identity", position="dodge")+
geom_point(aes(y = b / 10000),
position = position_dodge(width = 1))