I've plotted some data on a chart in python and then used
handles, labels = ax0_1.get_legend_handles_labels()
to get the labels and handles. The labels I get are ordered like this:
A1 01-01-01 01 ABC
A1 01-01-01 01 ABCD
A1 01-01-01 01 ABCDE
A1 01-01-01 02 ABC
A1 01-01-01 02 ABCD
A1 01-01-01 02 ABCDE
... but what I need is to sort the labels AND the corresponding handles so that the order would be this:
A1 01-01-01 01 ABC
A1 01-01-01 02 ABC
A1 01-01-01 01 ABCD
A1 01-01-01 02 ABCD
A1 01-01-01 01 ABCDE
A1 01-01-01 02 ABCDE
I've tried several things, but so far ended up with only a headache.
Anybody know how this be done ?