title: Make a multiline plot from .CSV file in matplotlib
body: <p>I've been trying for weeks to plot 3 sets of (x, y) data on the same plot from a .CSV file, and I'm getting nowhere. My data was originally an Excel file which I have converted to a .CSV file and have used <code>pandas</code> to read it into IPython as per the following code:</p>
  
  <pre><code>from pandas import DataFrame, read_csv
  import pandas as pd
  # define data location
  df = read_csv(Location)
  df[['LimMag1.3', 'ExpTime1.3', 'LimMag2.0', 'ExpTime2.0', 'LimMag2.5','ExpTime2.5']][:7]
  </code></pre>
  
  <p>My data is in the following format:</p>
  
  <pre class="lang-none prettyprint-override"><code>Type    mag1    time1   mag2    time2   mag3    time3
  
  M0      8.87    41.11   8.41    41.11   8.16    65.78;
  
  ...
  
  M6     13.95  4392.03  14.41 10395.13  14.66 25988.32
  </code></pre>
  
  <p>I'm trying to plot <code>time1</code> vs <code>mag1</code>, <code>time2</code> vs <code>mag2</code> and <code>time3</code> vs <code>mag3</code>, all on the same plot, but instead I get plots of <code>time..</code> vs <code>Type</code>, eg. for the code:</p>
  
  <pre><code>df['ExpTime1.3'].plot()
  </code></pre>
  
  <p>I get <code>'ExpTime1.3'</code> (y-axis) plotted against <code>M0</code> to <code>M6</code> (x-axis), when what I want is <code>'ExpTime1.3'</code> vs <code>'LimMag1.3'</code>, with x-labels <code>M0</code> - <code>M6</code>.</p>
  
  <ol>
  <li><p>How do I get <code>'ExpTime..'</code> vs <code>'LimMag..'</code> plots, with all 3 sets of data on the same plot?</p></li>
  <li><p>How do I get the <code>M0</code> - <code>M6</code> labels on the x-axis for the <code>'LimMag..'</code> values (also on the x-axis)?</p></li>
  </ol>
  
  <p>Since trying askewchan's solutions, which did not return any plots for reasons unknown, I've found that I can get a plot of <code>ExpTime</code>vs <code>LimMag</code>using <code>df['ExpTime1.3'].plot(),</code>if I change the dataframe index (df.index) to the values of the x axis (LimMag1.3). However, this appears to mean that I have to convert each desired x-axis to the dataframe index by manually inputing all the values of the desired x-axis to make it the data index. I have an awful lot of data, and this method is just too slow, and I can only plot one set of data at a time, when I need to plot all 3 series for each dataset on the one graph. Is there a way around this problem? Or can someone offer a reason, and a solution, as to why I I got no plots whatsoever with the solutions offered by askewchan?\</p>
  
  <p>In response to nordev, I have tried the first version again, bu no plots are produced, not even an empty figure. Each time I put in one of the <code>ax.plot</code>commands, I do get an output of the type:
   <code>[&lt;matplotlib.lines.Line2D at 0xb5187b8&gt;]</code>, but when I enter the command <code>plt.show()</code>nothing happens.
  When I enter <code>plt.show()</code>after the loop in askewchan's second solution, I get an error back saying <code>AttributeError: 'function' object has no attribute 'show'</code></p>
  
  <p>I have done a bit more fiddling with my original code and can now get a plot of <code>ExpTime1.3</code>vs <code>LimMag1.3</code> with the code <code>df['ExpTime1.3'][:7].plot()</code>,by making the index the same as the x axis (LimMag1.3), but I can't get the other two sets of data on the same plot. I would appreciate any further suggestions you may have. I'm using ipython 0.11.0 via Anaconda 1.5.0 (64bit) and spyder on Windows 7 (64bit), python version is 2.7.4.</p>