Matplotlib figure legends. Matplotlib is highly customizable, and having a huge code base means it might not be easy to find what I need quickly. A recurring problem that I often face is customizing figure legend. Although Matplotlib website provides excellent document, I decided to write down some tricks that I found useful on the topic of handling figure legends. First, as always, load.