title: How to improve the aspect of ggplot histograms with log scales and discrete values
body: <p>I am trying to improve the clarity and aspect of a histogram of discrete values which I need to represent with a log scale.  </p>
  
  <p>Please consider the following MWE</p>
  
  <pre><code>set.seed(99)
  data &lt;- data.frame(dist = as.integer(rlnorm(1000, sdlog = 2)))
  class(data$dist)
  ggplot(data, aes(x=dist)) + geom_histogram()
  </code></pre>
  
  <p>which produces</p>
  
  <p><img src="https://i.stack.imgur.com/c5BSF.jpg" alt="enter image description here"></p>
  
  <p>and then </p>
  
  <pre><code>ggplot(data, aes(x=dist)) + geom_line() + scale_x_log10(breaks=c(1,2,3,4,5,10,100))
  </code></pre>
  
  <p>which probably is even worse</p>
  
  <p><img src="https://i.stack.imgur.com/WVknh.jpg" alt="enter image description here"></p>
  
  <p>since now it gives the impression that the something is missing between "1" and "2", and also is not totally clear which bar has value "1" (bar is on the <em>right</em> of the tick) and which bar has value "2" (bar is on the <em>left</em> of the tick).</p>
  
  <p>I understand that technically ggplot provides the "right" visual answer for a log scale. Yet as observer I have some problem in understanding it.</p>
  
  <p>Is it possible to improve something?</p>
  
  <p>EDIT:</p>
  
  <p>This what happen when I applied Jaap solution to my real data</p>
  
  <p><img src="https://i.stack.imgur.com/tUXmv.png" alt="enter image description here"></p>
  
  <p>Where do the dips between x=0 and x=1 and between x=1 and x=2 come from? My value are discrete, but then why the plot is also mapping x=1.5 and x=2.5?</p>