title: How to add a date series to a matrix of data?
body: <p>I'm trying to add dates to a graph of multiple data series using matplot() and I can't find a solution. Any help would be greatly appreciated.</p>
  
  <p>For example, Let's create a simple matrix of 2 data series:</p>
  
  <pre><code>&gt; a &lt;-matrix(1+rnorm(20),10,2)
  &gt; a
              [,1]        [,2]
   [1,]  2.7540781  1.31428162
   [2,]  2.4630120  1.04378781
   [3,]  1.7556846 -0.08914417
   [4,]  0.9446534  1.59287973
   [5,]  1.2365692  1.28315556
   [6,] -0.7582962 -0.17436644
   [7,]  1.6519822  3.30782961
   [8,]  0.3979254  0.38058894
   [9,]  1.6826193  1.47889565
  [10,]  0.1343743  0.68098755
  </code></pre>
  
  <p>Next, let's create a date series:</p>
  
  <pre><code>&gt; dates &lt;- data.frame(days = seq(as.Date('2013-01-01'), by = 'days', length = 10))
  &gt; dates
           days
  1  2013-01-01
  2  2013-01-02
  3  2013-01-03
  4  2013-01-04
  5  2013-01-05
  6  2013-01-06
  7  2013-01-07
  8  2013-01-08
  9  2013-01-09
  10 2013-01-10
  </code></pre>
  
  <p>Any idea how I can graph series "a" so that it corresponds with the date series "dates"? Specifically, I'd like to be able to plot via matplot(), such as: </p>
  
  <pre><code>matplot(a,type="l")
  </code></pre>
  
  <p>With the the series "dates" running along the bottom in standard fashion. Thanks!</p>