作者dirls (???)
看板Python
标题[问题] win10 matplotlib 中文无法显示
时间Mon Jun 26 10:40:09 2017
大家好,
我的 python 跟 matplotlib 是用 anaconda 装的。
之前在 win7 的环境下,
在程式里面加入:
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']
图表上就可以正常显示中文。
但是换到 win10,
同样的程式,在 win7 及 XP 可以显示中文,但是在 win10 中文就会变成框框。
後来发现, win10 下没有 SimHei 这个字型,
於是到网路上下载後放进 C:\windows\Fonts 及
C:\Users\s9554\Anaconda2\Lib\site-packages\matplotlib\mpl-data\fonts\ttf
这两个位置,结果中文还是框框(TAT).....
也有试过改用 Microsoft JhengHei UI (微软正体黑),
但中文还是一样无法显示.........
想请问高手们,如何让中文正常显示?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.184.254.231
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1498444812.A.B10.html