title: Plotting 2 curves in the same graph in R
body: <p>Using R, I need to plot 2 curves in the same graph. So, I have to plot x1 vs. y1 and x2 vs. y2. Here "x1" are random but known numbers in the range of 0 to 12; "x2" are random but known numbers in the range of 0 to 9; and similarly some other known ranges for y1 and y2.</p>
  
  <p>I used the following code:</p>
  
  <pre><code>d&lt;-read.csv("ni1.csv")       # Reading in the data
  x1&lt;-d[,1]
  y1&lt;-d[,2]
  
  d2&lt;-read.csv("ni2.csv")
  x2&lt;-d2[,1]
  y2&lt;-d2[,2]
  
  plot(x1,y1,pch="*", col='blue',xlim=c(0, 12), ylim=c(0,1300),main='Load Vs. Extension   Curves',xlab='Extension', ylab='Load')
  par(new=TRUE)
  plot(x2, y2, pch="*", col= 'red',xlim=c(0, 9), ylim=c(0,1400), axes= FALSE, xlab='', ylab='' )
  </code></pre>
  
  <p>Now the issue is although I am getting the right curve for x1 vs. y1, the curve for x2 vs. y2 is in improper range. That is to say, the x-range for x2 vs. y2 is coming out to be outside the values that I have for plotting.</p>
  
  <p>Can anybody help solve this?
  Thank you very much for your support...</p>
  
  <p>Regards.</p>