matplotlib put legend next to line graph code example
Example 1: matplotlib legend out of plot
ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.05),
ncol=3, fancybox=True, shadow=True)
Example 2: python no label in legend matplot
ax.plot(randn(1000).cumsum(), 'k.', label='_nolegend_')