title: Scatter plot with overlapping points plotted side-by-side
body: <p>I'm trying to create a plot for my data using <code>ggplot2</code>. I'm looking to have a scatter plot on top of a <code>geom_boxplot()</code>, so I can display the points on top of the actual distribution.</p>
  
  <p>In my data, there are a few distinct categorical values (<code>Year</code> or <code>Gender</code>) of x and a range of assay values for y. If there are points with close y values in the same x category, I'd like to plot these points side by side on a horizontal line. I've tried playing around with <code>geom_jitter</code> and <code>geom_point</code>, with <code>position_dodge</code>, <code>position_stack</code> and <code>position_jitter</code>, but I am relatively new to R and I'm unable to implement this requirement.</p>
  
  <p>I'd really appreciate any help in how I should approach this problem. As of now, I'm using a <code>data.frame</code> and feeding it into a typical <code>ggplot2</code> graphing pipeline (<code>geom_boxplot(...) + geom_jitter(...) +</code> etc)</p>
  
  <p>Thank you!</p>
  
  <p>EDIT: </p>
  
  <p>Sample Data (<code>df</code>):</p>
  
  <pre><code>RecNo    Gender    Value
    1       M         12.0
    2       M         13.2
    3       F         13.4
    4       M         14.5
    5       F         16.0
    6       M         19.3
    7       F         7.5
    8       M         9.7
    9       F         11.2
    10      M         15.6
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>ggplot(df, aes(factor(Gender,levels=rev(levels(Gender))),Value)) 
  + stat_boxplot(geom='errorbar')
  + geom_boxplot(outlier.size=0,position=position_dodge(1),width=0.5)
  + geom_jitter(size=2,
  position=position_dodge(width=0.1,height=0),show_guide=FALSE)
  + ylab("Plasma Value") +xlab(label="Gender")
  + scale_y_continuous(breaks=seq(0,90,5))
  + ggtitle("Distribution")
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <p>While the code is but an attempt of mine to get to where I wanna go, I am quite sure it is my approach and not the code that is flawed. My ultimate goal is to customize the scatter plot such that points that are too close are "stacked" side-by-side. I'd appreciate suggestions on how I should be thinking about this problem. Thank you.</p>