Put legend outside frame

To move the legend outside the plot frame

ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))
plt.subplots_adjust(right=0.7)