开发者

Changing the text of clabel in Matplotlib

开发者 https://www.devze.com 2023-01-25 18:38 出处:网络
I would like to specify the text of my contour lab开发者_运维百科el (instead of the value of the contour I want to put a text)

I would like to specify the text of my contour lab开发者_运维百科el (instead of the value of the contour I want to put a text) I've tried:

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

but it doesn't work. Any idea?


Try this:

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

精彩评论

暂无评论...
验证码 换一张
取 消