title: matplotlib: Plot numpy arrays with None as values
body: <p>I have an array that looks like:</p>
  
  <pre><code>k = numpy.array([(1.,0.001), (1.1, 0.002), (None, None), 
                   (1.2, 0.003), (0.99, 0.004)])
  </code></pre>
  
  <p>I want to plot the values that are not <code>(None, None)</code> and keep the index of the array value. That is, I want a gap wherever there is a <code>(None, None)</code> value. </p>
  
  <p>When that is done I'd like to plot</p>
  
  <pre><code>y = k[:,0] + k[:,1]
  </code></pre>
  
  <p>but I can't even add the arrays together. I tried masking the array, but I lost the index values of the original <code>k</code> array.</p>
  
  <p>A minimal example:</p>
  
  <pre><code>import matplotlib.pyplot as pyplot
  import numpy
  
  x = range(5)
  k = numpy.array([(1.,0.001), (1.1, 0.002), (None, None), 
                   (1.2, 0.003), (0.99, 0.004)])
  
  Fig, ax = pyplot.subplots()
  
  # This plots a gap---as desired
  ax.plot(x, k[:,0], 'k-')
  
  # I'd like to plot
  #     k[:,0] + k[:,1]
  # but I can't add None
  
  # Here I get rid of the (None, None) values so I can add
  # But I lose the original indexing
  mask = k != (None, None)
  y = k[mask].reshape((-1,2))
  
  ax.plot(range(len(y)), y[:,0]+y[:,1], 'k--')
  </code></pre>