title: How to add legend based on color in scatterplot [matplotlib]
body: <p>I have been trying to add legend based on the color in a scatter plot in matplotlib. I have seen several example but they assume that each plot will have a label associated to it, and I haven't figure out how to do it without the "label" property and only base it on color. Currently I have the following code</p>
  
  <pre><code>plt.subplot(121)
  plt.gca().set_title('Female')
  survived = female_data[:,1]
  pclass = female_data[:,2]
  age = female_data[:,5]
  label_color = ['r' if i==0 else 'b' for i in survived]
  axes = plt.gca()
  axes.get_xaxis().set_visible(False)
  plt.scatter(age, pclass, color=label_color)
  </code></pre>
  
  <p>Which render something like this, I want red and blue to have a single label in the plot. Any idea? </p>
  
  <p><a href="https://i.stack.imgur.com/ki77q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ki77q.png" alt="enter image description here"></a></p>