title: Plotting a grid behind data, not in front in R
body: <p>I like to produce my own grid lines when plotting so I can control tick marks, etc. and I am struggling with this with the 'hist' plotting routine.</p>
  
  <pre><code>    hist(WindSpeed, breaks=c(0:31), freq=TRUE, col="blue", xaxt="n", yaxt="n", xlab="Wind Speed (m/s)",main="Foo", cex.main=1.5, cex.axis=1, cex.lab=1, tck=1, font.lab=2)
      axis(1, tck=1, ,col.ticks="light gray")
      axis(1, tck=-0.015, col.ticks="black")
      axis(2, tck=1, col.ticks="light gray", lwd.ticks="1")
      axis(2, tck=-0.015)
      minor.tick(nx=5, ny=2, tick.ratio=0.5)
      box()
  </code></pre>
  
  <p>Plot:
  <img src="https://i.stack.imgur.com/lRqc7.png" alt="enter image description here"></p>
  
  <p>I have then just been able to use the 'lines' or 'points' command to replot the data over top for other types of plots, but with the histogram its not so easy.</p>
  
  <p>Any help would be great.</p>
  
  <p>I added my code below and image based upon John's response...</p>
  
  <p>I added my code below and image based upon John's response...</p>
  
  <pre><code>hist(WindSpeed, breaks=30, freq=TRUE, col="blue", xaxt="n", yaxt="n", xlab="Wind Speed (m/s)",main="Foo", cex.main=1.5, cex.axis=1, cex.lab=1, font.lab=2)
  axis(1, tck=1, col.ticks="light gray")
  axis(1, tck=-0.015, col.ticks="black")
  axis(2, tck=1, col.ticks="light gray", lwd.ticks="1")
  axis(2, tck=-0.015)
  minor.tick(nx=5, ny=2, tick.ratio=0.5)
  box()
  hist(WindSpeed, add=TRUE, breaks=30, freq=TRUE, col="blue", xaxt="n", yaxt="n", xlab="Wind Speed (m/s)", main="Foo", cex.main=1.5, cex.axis=1, cex.lab=1, font.lab=2)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2LNB5.png" alt="enter image description here"></p>