title: Color based legend in python , matplotlib
body: <p>My question goes as follows:</p>
  
  <p>Imagine I have four lists <code>a</code>, <code>b</code>, <code>c</code>, <code>d</code>. I want to plot them by using the same radial grid <code>R</code>. For some reason <code>a</code>, <code>b</code> share a common property X and <code>c</code>, <code>d</code> share Y. Therefore I want <code>a</code>, <code>b</code> and <code>c</code>, <code>d</code> to appear in the same color respectively (green and blue), and I just want two labels to appear into the legend: one being green and resembling X and the other blue and resembling Y. Any ideas of a simple method to do it? An example:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  a =[2,4,6,8,10]
  b =[3,6,9,12,15]
  c =[1,4,9,16,25]
  d =[1,8,27,64,125]
  R =[0,1,2,3,4]
  
  plt.plot(R,a,color ='green')
  plt.plot(R,b,color ='green')
  plt.plot(R,c,color ='blue')
  plt.plot(R,d,color ='blue')
  plt.legend('blue'= X,'green'=Y)
  plt.show()
  </code></pre>