title: How to draw a graph by using CSV file in Python
body: <p>I have to draw a graph  by using stock prices in APPLE or SAMSUNG data in CVS file by using Python language.SAMSUNG and APPLE data saved in separate files in same folder.</p>
  
  <p>Desired interface like this <a href="https://i.stack.imgur.com/y8eng.png" rel="nofollow noreferrer">Desired Interface</a> If user select Samsung or APPLE in check box.(Only one can select at a time and draw,If I select Apple then Samsung is disabled)Then draw a graph between Date vs Open and Close by selected types from getting suitable CVS file in that folder.In here I give sample data set of apple.csv,it look likes as follows and Samsung data set also like this;</p>
  
  <pre><code>Name,Date,Open,High,Low,Close,Volume
  AAPL,02 Jan 2017,115.82,115.82,115.82,115.82,0
  AAPL,03 Jan 2017,115.8,116.33,114.76,116.15,28781800
  AAPL,04 Jan 2017,115.85,116.51,115.75,116.02,21118100
  AAPL,05 Jan 2017,115.92,116.86,115.81,116.61,22193500
  </code></pre>
  
  <p>I am newer to this language So anyone,please give any guidance to do this task.So please If anyone can give to correct guidance path to do this,it will great help for me.</p>
  
  <p>Code is I have tried:(But this is not correct because I want to selected column to draw Date vs. Open and Close)</p>
  
  <pre><code>import  matplotlib.pyplot as plt
  import  csv
  dateOfx=[]
  open_price_y1=[]
  close_price_y2=[]
  
  with open('E:\\Project\Data set\\apple.csv','r') as csvfile:
      plots =csv.reader(csvfile,delimiter=',')
      for column in plots:
          dateOfx.append(int(column[2]))
          open_price_y1.append(int(column[3]))
          close_price_y2.append(int(column[5]))
  
  plt.plot(dateOfx,open_price_y1,close_price_y2 ,label='Loaded from file!')
  plt.xlabel('Date')
  plt.ylabel('Open')
  plt.ylabel('Close')
  
  plt.title('Share Market Price')
  plt.legend()
  plt.show()
  </code></pre>