Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matplotlib contour plot labels

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?

like image 311
zeus300 Avatar asked Dec 20 '25 22:12

zeus300


1 Answers

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

like image 151
zeus300 Avatar answered Dec 23 '25 13:12

zeus300