Unicode in ipython notebook

这一生的挚爱 提交于 2019-12-05 13:10:53

The error message is telling you what to do:

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

Make your xlabel a unicode string:

ax.set_xlabel(u"something at 55°")

The problem is that the font you are using to write the label does not have the ° sign. Try to use matplotlib's mathtext instead and format the ° with latex:

ax.set_xlabel("something at 55$^\circ$")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!