I'm combining a contour plot and an imshow. Depending on the colormap and the data, it sometimes happens that the contour labels have a color very similar to the pixmap and are therefore hard to read.
I remember seeing a matplotlib contour demo that showed how the text labels could be surrounded with a little white halo so as to make them readable regardless of the background, but I can't find it anymore. Does anyone know how to do that?
roadrunner66's answer worked, but it was not the halo effect I was looking for. However, I finally found it. You can use PathEffects as shown here:
http://matplotlib.org/examples/pylab_examples/patheffect_demo.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With