Create matplotlib legend out of the figure
- by Werner
I added the legend this way:
leg = fig.legend((l0,l1,l2,l3,l4,l5,l6),
('0 Cl : r2, slope, origin',
'1 Cl :'+str(r1b)+' , '+str(m1)+' , '+str(b1),
'2 Cl :'+str(r2b)+' , '+str(m2)+' , '+str(b2),
'3 Cl :'+str(r3b)+' , '+str(m3)+' , '+str(b3),
'4 Cl :'+str(r4b)+' , '+str(m4)+' , '+str(b4),
'5 Cl :'+str(r5b)+' , '+str(m5)+' , '+str(b5),
'6 Cl :'+str(r6b)+' , '+str(m6)+' , '+str(b6),
), 'upper right')
but the legend appears inside the plot.
How can I tell matplotlib to put it to the right of the plot and at the right?