title: Conditional coloring in Matplotlib using Numpy's where
body: <p>What I want to achieve is to conditionally color my scatter plot. I followed this <a href="https://stackoverflow.com/questions/40803570/python-matplotlib-scatter-plot-specify-color-points-depending-on-conditions/40804861#">post</a>, but I get <code>TypeError: len() of unsized object</code>. I'm doing the following</p>
  
  <pre><code>for i in range(n_cells):
     col = np.where(cell_list[i].m_n == 1, 'g', 'k')
     plt.scatter(cell_list[i].x, cell_list[i].y, c = col, alpha = 0.5, s = 2)
  </code></pre>
  
  <p><code>cell_list</code> is an array of <code>cell</code>s, which is a user-defined object. I have checked and ensured that <code>col</code> is an array of <code>g</code> and <code>k</code> of the correct size. Moreover, if you change <code>c = col</code> to <code>c = 'b'</code> for example, the plot works correctly. I'm relatively new to Python, so I cannot find what the issue is.</p>