title: Align a time grid in R
body: <p>As a gnuplot user for many years, I'm going to despair with R trying to align the grid for time-based values to the x-axis labels, i.e. to some "reasonable" multiples of human time (minutes, hours, days, etc.). In Gnuplot it's more or less automatic...</p>
  
  <p>For example I have these time values (I still couldn't find out how to use <code>dump()</code> properly, so a simplified example without measurement data):</p>
  
  <pre><code>&gt; range(perf$time)
  [1] "2016-11-22 02:26:02 CET" "2016-11-22 04:02:12 CET"
  &gt; length(perf$time)
  [1] 49
  &gt; plot(perf$time, 1:length(perf$time))
  &gt; grid()
  &gt;
  </code></pre>
  
  <p>The plot window looks like this:
  <a href="https://i.stack.imgur.com/ZgJAj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZgJAj.jpg" alt="R plot window with time-based mis-aligned grid"></a>
  So you see that "3:00" matches a grid line, but no other value. I tried to make the number of lines matching, but couldn't get the alignment right. Isn't there a simple solution?</p>
  
  <p>None of the solutions for "Placing the grid along date tickmarks" uses <code>grid()</code>, so is <code>grid()</code> rather useless?</p>