title: How to plot/stream data from a csv file in python?
body: <p>I have a csv file with the following columns {time,x,y,z} and approximately 100000 rows. I would like to "live stream/animate" the data in real time so that I can get an overview of what is happening.</p>
  
  <p>attempt:</p>
  
  <pre><code>def generate_pieces(file, piecesize=128):
  
  piece = []
  for i, line in enumerate(file): 
      if (i % piecesize == 0 and i &gt; 0):
          yield piece
          del piece[:]
      piece.append(line)
  yield piece
  
  file = csv.reader(open('file_name.csv'))
  for piece in generate_pieces(file):
          x_data = []
          y_data = []
          z_data = []            
          t_vec = []
  
          for row in piece:
              x_data.append(row[1])
              y_data.append(row[2])
              z_data.append(row[3])
              d = datetime.datetime.strptime(row[0], '%Y-%m-%d-%H%M%S')
              d_simp = (d.hour+ (1/60)*d.minute + (1/3600)*d.second)
              conversion = 86400*d.day+3600*d.hour+60*d.minute + d.second                               
              t_vec.append(conversion)                            
  
          x_data = [int(i) for i in x_data] # Converts values to int type.    
          y_data = [int(i) for i in y_data]        
          z_data = [int(i) for i in z_data] 
  </code></pre>
  
  <p>So my attempt involves taking pieces of data of length 128. From here I want to stream 128 points at a time in a live plot? I am not sure where to go from here</p>