词云


import matplotlib.pyplot as plt
from wordcloud import WordCloud
import jieba

text_from_file_with_apath = open('词云.txt').read()

wordlist_after_jieba = jieba.cut(text_from_file_with_apath, cut_all = True)

wl_space_split = " ".join(wordlist_after_jieba)

my_wordcloud = WordCloud().generate(wl_space_split)

plt.imshow(my_wordcloud)
plt.axis("off")
plt.show()
posted @ 2017-10-18 17:05  心静水境  阅读(83)  评论(0编辑  收藏  举报