title: Dynamically Set X limits on time plot
body: <p>I am wondering how to dynamically set the x axis limits of a time series plot containing two time series with different dates.  I have developed the following code to provide a reproducible example of my problem.</p>
  
  <pre><code>#Dummy Data
  Data1 &lt;- data.frame(Date = c("4/24/1995","6/23/1995","2/12/1996","4/14/1997","9/13/1998"), Area_2D = c(20,11,5,25,50))
  Data2 &lt;- data.frame(Date = c("6/23/1995","4/14/1996","11/3/1997","11/6/1997","4/15/1998"), Area_2D = c(13,15,18,25,19))
  Data3 &lt;- data.frame(Date = c("4/24/1995","6/23/1995","2/12/1996","4/14/1996","9/13/1998"), Area_2D = c(20,25,28,30,35))
  Data4 &lt;- data.frame(Date = c("6/23/1995","4/14/1996","11/3/1997","11/6/1997","4/15/1998"), Area_2D = c(13,15,18,25,19))
  
  #Convert date column as date
  Data1$Date &lt;- as.Date(Data1$Date,"%m/%d/%Y")
  Data2$Date &lt;- as.Date(Data2$Date,"%m/%d/%Y")
  Data3$Date &lt;- as.Date(Data3$Date,"%m/%d/%Y")
  Data4$Date &lt;- as.Date(Data4$Date,"%m/%d/%Y")
  
  #PLOT THE DATA
  max_y1 &lt;- max(Data1$Area_2D)
  
  # Define colors to be used for cars, trucks, suvs
  plot_colors &lt;- c("blue","red")
  
  plot(Data1$Date,Data1$Area_2D, col=plot_colors[1], 
       ylim=c(0,max_y1), xlim=c(min_x1,max_x1),pch=16, xlab="Date",ylab="Area", type="o")
  par(new=T)
  plot(Data2$Date,Data2$Area_2D, col=plot_colors[2], 
       ylim=c(0,max_y1), xlim=c(min_x1,max_x1),pch=16, xlab="Date",ylab="Area", type="o")
  </code></pre>
  
  <p>The main problem I see with the code above is there are two different x axis on the plot, one for Data1 and another for Data2.  I want to have a single x axis spanning the date range determined by the dates in Data1 and Data2.  </p>
  
  <p>My questions is:</p>
  
  <p>How do i dynamically create an  x axis for both series? (i.e select the minimum and maximum date from the data frames 'Data1' and 'Data2') </p>