title: How to make custom legend in matplotlib
body: <p>I currently generate my legend with matplotlib this way:</p>
  
  <pre><code>if t==25:
      l1,l2 = ax2.plot(x320,vTemp320,'or',x320,vAnaTemp320,'-r')
  elif t==50:
      l3,l4 = ax2.plot(x320,vTemp320,'ob',x320,vAnaTemp320,'-b')
  else:
      l5,l6 = ax2.plot(x320,vTemp320,'og',x320,vAnaTemp320,'-g')
  plt.legend((l1,l2,l3,l4,l5,l6), ('t=25 Simulation', 't=25 Analytical','t=50 Simulation', 't=50 Analytical','t=500 Simulation', 't=500 Analytical'),
     bbox_to_anchor=(-.25, 1), loc=2, borderaxespad=0.,prop={'size':12})
  </code></pre>
  
  <p>Which somehow works see <a href="https://i.stack.imgur.com/XgupM.jpg" rel="noreferrer">1</a>. But I have duplicated information in my legend.</p>
  
  <p>I would prefer to seperate the legend. So that I have different colored lines corresponding to the time t. And a normal line as my Analytical solution an dots for the results of my simulation.</p>
  
  <p>Something like that</p>
  
  <p>--(red line) t = 25</p>
  
  <p>--(blue line) t = 50</p>
  
  <p>--(green line) t = 500</p>
  
  <p>o Simulaton</p>
  
  <p>-- Analytical Solution</p>
  
  <p>Does anyone now how I could achieve this with matplotlib?</p>
  
  <p><img src="https://i.stack.imgur.com/XgupM.jpg" alt="The current image"></p>