I have the following code:
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use(\'Agg\')
import matplotlib.pyplot as plt
matplotlib.style.
When the legend doesn't work out you can always make your own easily like this:
import matplotlib
name_to_color = {
'Expected': 'green',
'Provided': 'red',
'Difference': 'blue',
}
patches = [matplotlib.patches.Patch(color=v, label=k) for k,v in name_to_color.items()]
matplotlib.pyplot.legend(handles=patches)