I\'m making a scatter plot which looks like this:
(MWE at bottom of qu
You can retrieve the label of each legend handle with lh.get_label()
if you want to map colors to specific labels.
For my purposes it worked best to create a dict from legendHandles
and change the colors like so:
ax = plt.gca()
leg = ax.get_legend()
hl_dict = {handle.get_label(): handle for handle in leg.legendHandles}
hl_dict['9'].set_color('red')
hl_dict['8'].set_color('yellow')