line = [[(0, 0)]]
lc = LineCollection(2 * line, linestyles=['solid', 'dashed'], colors=[
    'black', 'black'])
lc2 = LineCollection(2 * line, linestyles=['solid', 'dashed'], colors=[
    'blue', 'blue'])
lc3 = LineCollection(3 * line, linestyles=['solid', 'dashed', 'solid'],
    colors=['blue', 'red', 'green'])
plt.legend([lc, lc2, lc3], ['text', 'more text', 'extra line'], handler_map
    ={type(lc): HandlerDashedLines()}, handlelength=2.5)
Два стиля линий в легенде