title: R ggplot - getting all discrete x values to be displayed on axis in histogram
body: <p>With a data frame <code>df</code> and a column <code>col_name</code> I use the below function to generate histograms like in the figure below.</p>
  
  <pre><code>myHistogramDensity &lt;- function(df, col_name) {
    p1 &lt;- ggplot(df, aes_string(x=col_name)) + 
      geom_histogram(aes(y=..density..), binwidth=1, colour="black", fill="white")
    p1 &lt;- p1 + scale_y_continuous(labels=percent) 
    p1 &lt;- p1 + annotation_custom(tableGrob(myMinMaxMed(df, col_name), rows = NULL),
                                 xmin=10, xmax=13, ymin=0.5, ymax=0.6)
    return (p1)
  }
  </code></pre>
  
  <p>This gives me a histogram like below.</p>
  
  <p>How do I get the x-axis to display labels for all discrete values present in <code>col_name</code> ?</p>
  
  <p><a href="https://i.stack.imgur.com/j8hKn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j8hKn.jpg" alt="histogram"></a></p>