Setup Legend in Matplotlib
from matplotlib.font_manager import FontProperties # font size of legend fontP = FontProperties() fontP.set_size('xx-small') # location of legend xl = 1 yl = 0 # display lengend plt.legend(loc=yl, ncol=xl,prop = fontP)