title: legend inside a loop in a subplot in Matplotlib: what is wrong with my code?
body: <p>I have a plot with 6 different subplots. I iterate through a loop to make each of the subplots and I want to add the legend for each subplot at this time too. So here is an easy example:</p>
  
  <pre><code>matrixSol = scipy.random.random((6,6,4))
  print matrixSol
  mylegend = ['10 Million','15 Million','1 Million','20 Million','25 Million','5 Million']
  
  for k in range(6):
      print k
      xs = matrixSol[k,:,0]
      ys = matrixSol[k,:,1]
      zs = matrixSol[k,:,3]
      plt.subplot(2,3,k+1)
      plt.plot(ys, zs,'o', c=color[k], markersize=10)#marker = styles[k])
      #print mylegend[k]
      plt.legend((mylegend[k]),loc=2)
      plt.xlabel('X')
      plt.ylabel('Y (%)')
  plt.show()
  </code></pre>
  
  <p>The problem is that I am getting a legend that picks only the first symbol of each member of the list, please see figure attached.
  What is wrong with my code????
  it is such a simple thing! thank you very much! any help will be appreciated!<img src="https://i.stack.imgur.com/CcceX.png" alt="enter image description here"></p>