Fix MatplotlibDeprecationWarning: The "loc" positional argument to legend is deprecated