title: matplotlib: 2 different legends on same graph
body: <p>I have a plot where different colors are used for different parameters, and where different line styles are used for different algorithms. The goal is to compare the results of the different algorithms performed with similar parameters. It means in total I use 4 different colors, and 3 different line styles, for a total of 12 plots on the same graph.</p>
  
  <p>I actually build the legend based on colors, associating each color with the corresponding parameter. Now I'd like to display a second legend on the same graph, with the meaning of each line style. It is possible to achieve that? How?</p>
  
  <p>Here is what my code looks like actually:</p>
  
  <pre><code>colors = ['b', 'r', 'g', 'c']
  cc = cycle(c)
  for p in parameters:
  
      d1 = algo1(p)
      d2 = algo2(p)
      d3 = algo3(p)
  
      pyplot.hold(True)
      c = next(cc)
      pyplot.plot(d1, '-', color=c, label="d1")
      pyplot.plot(d1, '--', color=c)
      pyplot.plot(d2, '.-', color=c)
  
  pyplot.legend()
  </code></pre>