title: How to read multiple CSV files, store data and plot in one figure, using Python
body: <p>I have several .csv files, and i wanted to draw a graph from this files.
  These files contains two columns , whose the first column is the same for each csv files.</p>
  
  <p>file1.csv:</p>
  
  <pre><code>20 -4.140462670
  25 -4.140537060
  30 -4.140571620
  35 -4.140581580
  40 -4.140584350
  </code></pre>
  
  <p>file2.csv:</p>
  
  <pre><code>20 -4.140468880
  25 -4.140542900
  30 -4.140577590
  35 -4.140587560
  40 -4.140590330
  </code></pre>
  
  <p>I tried with the script below, in order to plot the first:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  from matplotlib.ticker import FormatStrFormatter
  
  with open('file1.csv') as f:
      f=[x.strip() for x in f if x.strip()]
      data=[tuple(map(float,x.split())) for x in f[0:]]
      oX=[x[0] for x in data]
      oY=[x[1] for x in data]
  
  plt.figure(figsize=(9,6))
  ax = plt.subplot(111)
  
  ax.yaxis.set_major_formatter(FormatStrFormatter('%.4f'))
  ax.plot(oX, oY, color='blue', linestyle='dashdot', linewidth=2, marker='o', markerfacecolor='red', markeredgecolor='black',markeredgewidth=2, markersize=6)
  
  plt.show()
  </code></pre>
  
  <p>here is the result:
  <a href="https://i.stack.imgur.com/BeDpe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BeDpe.png" alt="enter image description here"></a></p>
  
  <p>but I want to draw a graph that contains both curves (file1.csv and file2.csv)</p>
  
  <p>In the other time,the problem is solved (with xmgrace software) using the command: xmgrace -free -nxy *
  <a href="https://i.stack.imgur.com/7iMmF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7iMmF.png" alt="enter image description here"></a></p>
  
  <p>my question is: can I draw a graph that contains multiple curves, after reading multiple files. csv (file1.csv, file2.csv, file3.csv ....).</p>
  
  <p>I note that I have:  <br/>
  1) n amount of CSV <strong>(file1.csv, file2.csv, file3.csv ....).</strong> <br/>
  2) same X coordinates  <br/>
  3) different Y coordinates  </p>