class LegendTitle(object):

    def __init__(self, text_props=None):
        self.text_props = text_props or {}
super(LegendTitle, self).__init__()

def legend_artist(self, legend, orig_handle, fontsize, handlebox):
    x0, y0 = handlebox.xdescent, handlebox.ydescent
title = mtext.Text(x0, y0, '\\underline{' + orig_handle + '}', usetex=True,
    **self.text_props)
handlebox.add_artist(title)
return title
[line1] = plt.plot(list(range(10)))
[line2] = plt.plot(list(range(10, 0, -1)), 'o', color='red')
plt.legend(['Title 1', line1, 'Title 2', line2], ['', 'Line 1', '',
    'Line 2'], handler_map={str: LegendTitle({'fontsize': 18})})
plt.show()
Субтитры в легенде Matplotlib