title: ggplot2 find number of counts in histogram maximum
body: <p>I have a short R script which plots a few histograms using ggplot2. How can I automatically set the ymax limit in the histogram based on the maximum frequency in the histogram (plus 10%) i.e</p>
  
  <pre><code>scale_y_continuous(limits= c(0,ymax*1.1)
  
  plot = ggplot(data, aes(myo_activity)) +
    geom_histogram(binwidth=0.5, aes(fill=..count..))
  plot + scale_x_continuous(expand = c(0,0), limits = c(30,90)) + 
    scale_y_continuous(expand = c(0,0), limits = c(0,140))
  </code></pre>