Is there a way to change the font color of the legend in a matplotlib plot?
Specially in occasions where the background of the plot is dark, the default black text in
Because plt.setp broadcasts over iterables, you can also modify the text color in one line:
plt.setp
# Show some cool graphs legend = plt.legend() plt.setp(legend.get_texts(), color='w')
The last line will apply the colour to all elements in the collection of texts.