Location of the legend in PyPlot

I would like to change both. Tried to find this in PyPlot Cookbook, but it seems it is not mentioned there.