title: ggplot2: Dodge points with categorical axis and overlaying points
body: <p>Consider the following graph</p>
  
  <pre><code>d1 = data.frame(x=LETTERS[1:2],y=c(1.9,2.3))
  d2 = data.frame(x=LETTERS[1:2],y=c(1.9,3))
  
  ggplot(d1, aes(x=x,y=y)) + geom_point(data=d1, color="red") + 
                geom_point(data=d2, color="blue")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ncxiT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ncxiT.png" alt="enter image description here"></a></p>
  
  <p>The goal is to dodge the blue toward the right and the red dots toward the left. One way would be to merge the two data.frames</p>
  
  <pre><code>d1$category=1
  d2$category=2
  d = rbind(d1,d2)
  d$category = as.factor(d$category)
  ggplot(d, aes(x=x,y=y, color=category)) +
       geom_point(data=d, position=position_dodge(0.3)) + 
        scale_color_manual(values=c("red","blue"))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FprMy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FprMy.png" alt="enter image description here"></a></p>
  
  <p>Is there a another solution (a solution that does not require merging the data.frames)?</p>