关于词云无法显示中文的问题

今天在做词云的过程中,发现做的词云,中文部分全部都显示的为框框,于是百度了一下:

词云的中文问题,关键在Wordcloud中加入:

font_path='./fonts/simhei.ttf'

如下所示:


wc = WordCloud(font_path='./fonts/simhei.ttf',background_color='White',mask=graph) # font_path='./fonts/simhei.ttf' 显示中文


参考地址:https://www.cnblogs.com/cymwill/p/7613197.html

猜你喜欢

转载自blog.csdn.net/qq_40276310/article/details/80329980