今天在做词云的过程中,发现做的词云,中文部分全部都显示的为框框,于是百度了一下:
词云的中文问题,关键在Wordcloud中加入:
font_path='./fonts/simhei.ttf'
如下所示:
wc = WordCloud(font_path='./fonts/simhei.ttf',background_color='White',mask=graph) # font_path='./fonts/simhei.ttf' 显示中文
今天在做词云的过程中,发现做的词云,中文部分全部都显示的为框框,于是百度了一下:
词云的中文问题,关键在Wordcloud中加入:
font_path='./fonts/simhei.ttf'
如下所示:
wc = WordCloud(font_path='./fonts/simhei.ttf',background_color='White',mask=graph) # font_path='./fonts/simhei.ttf' 显示中文