Best color to annotate against viridis

Viewed 482

What would be the 'best' color to use for annotations against viridis. I am looking for a color with maximum clarity and contrast. Since there is so much science going into the viridis colorscheme, I am hoping there is an 'ideal' color for annotating on viridis. As you can see below, using a standard 'red' in matplotlib does not have nice visibility.

EDIT: I would not consider this pure opinion, as there is a rigorous science behind the viridis color scheme, and I am interested in answers that fit within that framework.

enter image description here

1 Answers

Following the comment of @JohanC, I agree that using different face and edge colors is a good idea. Here is the example:

# It is only a fraction of code to reproduce the figure, just an example of text highlight
import matplotlib.patheffects as PathEffects
txt = axes.text(1.15, 8.25,"Good fit at dense and\nCO-rich conditions", color='w', rotation=45)
txt.set_path_effects([PathEffects.withStroke(linewidth=1, foreground='k')])

patheffects on viridis

Related