title: Read CSV and plot colored line graph
body: <p>I am trying to plot a graph with colored markers before and after threshold value. If I am using for loop <code>for</code> reading the parsing the input file with time <code>H:M</code> I can plot and color only two points. But for all the points I cannot plot. </p>
  
  <p>Input </p>
  
  <pre><code>akdj 12:00 34515 sdfg
  sgqv 13:00 34626 ssfgb
  dfbb 13:00 14215 gghgws
  ajdf 13:30 14224 gdgva
  dsfb 13:45 25672 FW 
  sfhh 14:00 85597 adsfb
  </code></pre>
  
  <p>program</p>
  
  <pre><code># ma masked array
  import csv
  import datetime as dt
  import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib.pyplot import  plot
  
  threshold = 30000
  x,y = [],[]
  csv_reader = csv.reader(open('Count_Time.csv'))
  
  for line in csv_reader:
      y.append(int(line[2]))
      x.append(dt.datetime.strptime(line[1],'%H:%M'))
  
  #plt.figure()
  
  plt.plot(x,y, color='blue')
  
  #Add below threshold markers
  below_threshold = y &lt; threshold
  plt.scatter(x[below_threshold], y[below_threshold], color='green') 
  
  # Add above threshold markers
  above_threshold = np.logical_not(below_threshold)
  plt.scatter(x[above_threshold], y[above_threshold], color='red')
  
  
  plt.show()
  </code></pre>
  
  <p>Wrong Output </p>
  
  <p><img src="https://i.stack.imgur.com/k8hfh.png" alt="enter image description here"></p>
  
  <p>When I used the below code to read file that did not show any error but showed a blank graph layout. </p>
  
  <pre><code>data = np.genfromtxt('Count_Time.csv', delimiter=",")
  x = data[:,1]
  y = data[:,2]
  </code></pre>
  
  <p>When changed this way following error is shown</p>
  
  <pre><code>data = np.loadtxt('Count_Time.csv', delimiter=',', dtype='str, time, int, str')
  x = data[:,1]
  y = data[:,2]
  </code></pre>
  
  <p>Error</p>
  
  <pre><code> data = np.loadtxt('Count_Time.csv', delimiter=',', dtype='str, time, int, str')
    File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 798, in loadtxt
      dtype = np.dtype(dtype)
  TypeError: data type "time" not understood
  </code></pre>