在python 2.7中写法语字符

时间:2018-05-29 09:29:58

标签: python python-2.7 matplotlib unicode

我正在尝试在python 2.7中编写法语字符,如下所示:

plt.xlabel("Débit")

但是,我有这个错误:

ValueError: matplotlib display text must have all code points < 128 or use Unicode strings

请问有解决方案吗?

1 个答案:

答案 0 :(得分:2)

错误ValueError: matplotlib display text must have all code points < 128 or use Unicode strings告诉您使用unicode字符串,因此:

plt.xlabel(u"Débit")
相关问题