The position of the legend should be in "window coordinates", similar to mpl.legend(loc='upper left')