Select the position of the legend:
plt.legend(['scores'], bbox_to_anchor=(0., 1.), fontsize=12)
Create a free account to access the full topic