title: re-sizing ggplot geom_dotplot
body: <p>I'm having trouble creating a figure with <code>ggplot2</code>. I am using <code>geom_dotplot</code> with center stacking to display my data which are discrete values for 4 categories.</p>
  
  <p>For aesthetic reasons I want to customize the positions of the dots so that</p>
  
  <ol>
  <li>reduce the empty space between dots along the y axis, (ie the dots are 1 value large)</li>
  <li>The distributions fit and don't overlap</li>
  </ol>
  
  <p>I've adjusted the <code>bin</code> and <code>dotsize</code> to achieve aesthetic goal 1, but that requires me to fiddle with the ylim() parameter to make sure that the groups fit in the plot. This results in a plot with more whitw space and few numbers on the y axis.</p>
  
  <p>Question: Can anyone explain a way to resize the empty space on this plot?</p>
  
  <p>My code is below:.</p>
  
  <pre><code>plot &lt;- ggplot(figdata, aes(y=Counts, x=category, col=strain)) + 
              geom_dotplot(aes(fill=strain), dotsize=1, binwidth=.7, 
                           binaxis= "y",stackdir ="centerwhole", stackratio=.7) +
              ylim(18,59)
  
  plot + scale_color_manual(values=c("#E69F00", "#56B4E9")) + 
         geom_errorbar(stat="hline", yintercept="mean", 
                       aes( ymax=..y..,ymin=..y.., group = category, width = 0.5), 
                       color="black")
  </code></pre>
  
  <p>Which produces:</p>
  
  <p><a href="https://i.stack.imgur.com/b1ll6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b1ll6.jpg" alt="enter image description here"></a></p>
  
  <p>EDIT: Incorporating jitter will allow the all the data to fit, but I don't want to add noise to this data and would prefer to show it as discreet data.
  adjusting the binwidth and dotsize to 0.3 as suggested below also fits all the data, however it leaves too much white space.</p>
  
  <p><a href="https://i.stack.imgur.com/zQVeF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zQVeF.jpg" alt="enter image description here"></a></p>
  
  <p>I think that I might have to transform my data so that the values are steps smaller than 1, in order to get everything to fit horizontally and dot sizes to big large enough to reduce white space.</p>