title: How to correctly use a for loop for plotting multiple lines from a csv in python?
body: <p>I am in the processing of learning Python (Basic question coming) and I have lots of data that comes out of some analyses as CSV files that look like the following:</p>
  
  <p><a href="https://i.stack.imgur.com/X9qtL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/X9qtL.png" alt="Example data table"></a></p>
  
  <p>I am trying to recreate the plot below (currently I do things like this in Excel and with the volume of data coming out and the complexity of the visualizations, I want to make things more efficient.</p>
  
  <p><a href="https://i.stack.imgur.com/xMzwE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xMzwE.png" alt="Plot I am trying to recreate"></a></p>
  
  <p>I tried to use the concept of For Loops to plot a line for each different "SectionName" in that column but am clearly missing something. </p>
  
  <pre><code>#read CSV
  df=pd.read_csv('/Users/F/Documents/Data/LinesLoopTest.csv')
  
  #Make Variables from dataframe columns
  Value = df['Value']
  Position = df['Xposition']
  Section = df['SectionName']
  
  #Setup Figure
  fig = plt.figure(figsize=(6,3))
  ax1 = fig.add_subplot(1,1,1)
  ax1.set_title('Sections')
  ax1.set_xlabel("XPosition")
  ax1.set_ylabel("Value")
  
  #plot lines by SectionName
  for name in ['A', 'B', 'C']:
      plt.plot(Position, Value)
  
  plt.show()
  </code></pre>
  
  <p>I realize this is a simple question, I just have not found an explanation so far where I can actually understand the process to the point that I can recreate it and then build on it.</p>