Modifying Dictionary Text in Matplotlib

I would like to specify the text of my outline label (instead of the value of the outline that I want to put in the text) I tried:

CS = contour(X, Y, Z, [0.5], linewidths=1, colors='k') plt.clabel(CS, fontsize=10, inline=1, text=r'$\alpha=0$') 

but that will not work. Any idea?

+6
numpy matplotlib
source share
1 answer

Try the following:

 plt.clabel(CS, fontsize=10, inline=1, fmt=r'$\alpha=0$') 
+5
source share

All Articles