I have the same problem as this guy here, so I want to put my legend outside the plot, but the savefig does not work. Additionally, I am working with the subplots environment. So let me phrase the problem here as general as possible:
fig, axarr = plt.subplots(n,m)
#... (plotting)...
axarr[k,l].legend(loc=(X,Y)) # X and Y such that outside of plot
plt.savefig("test.pdf")
By the way, for me the keyword 'bbox_inches' does not work.