handles = []
for i, c in list(color.items()):
    handles.append(mpatches.Patch(color=c, label=labels[i - 1]))
plt.legend(handles=handles, loc='best')
fig.autofmt_xdate()
plt.show()
Plotting legend with correct labels python