title: Matplotlib plotting- two data sets with different no. of data points
body: <p>I am trying to plot two data sets into the same graph using matplotlib. No. of data points for the first pair of <code>(x1,y1)</code> is 150. No. of data points for the second pair <code>(x2,y2)</code> is 100. Please note that the range for <code>x1</code> and <code>x2</code> is from 0.0 to 1.0. Only the no. of data points are different. When I try to plot these into the same graph for comparison,</p>
  
  <p>The error message that appears is: </p>
  
  <p><code>"x and y must have same first dimension"</code>. </p>
  
  <p>Code snippet below for your reference:</p>
  
  <pre><code>def main():
      x1,y1 = np.loadtxt('txt1.txt',unpack=True)
      x2,y2 = np.loadtxt('txt2.txt',unpack=True)
      plt.figure()
      plt.plot(x1,y1)
      plt.plot(x2,y2)
  
  main()
  </code></pre>