title: How to create a stair step plot of data in R/ggplot2?
body: <p>I have a list of points and I'd like to plot them and connect them with stair steps, like the following screenshot.</p>
  
  <pre><code>df &lt;- read.table('out.dat')
  df &lt;- df[df$V1&gt;0,]
  st &lt;- stats.bin(x=df$V1, y=df$V2, N=100)
  df2 &lt;- as.data.frame(st$stats["mean",])
  names(df2) &lt;- c('mean.energy')
  plot(df2$mean.energy, type="s",
      xlab="Off-axis distance (mm)", ylab="Mean Energy (MeV)")
  </code></pre>
  
  <p>How could I achieve the same with ggplot2 ?</p>
  
  <p><img src="https://i.stack.imgur.com/x8w2T.png" alt="enter image description here"></p>