title: plotting a graph with date on the x-axis in R
body: <p>I am trying to do a plot with date on x-axis with an interval of 1 month and date values rotated for clarity.</p>
  <pre><code>r=runif(100)
  d &lt;- as.Date(&quot;2001/1/1&quot;) + 70*sort(r)
  plot(d,r,type=&quot;l&quot;,xaxt=&quot;n&quot;)
  axis.Date(1, at=seq(d[1],d[100],&quot;month&quot;), format=&quot;%m/%d/%Y&quot;)
  </code></pre>
  <p>This doesn't really work. I am trying to get something similar to the following graph:</p>
  <p><img src="https://i.stack.imgur.com/pl5QE.jpg" alt="Reference graph" /></p>