词云图

# -*- coding utf-8 -*-

import matplotlib.pyplot as plt

from wordcloud import WordCloud

import jieba

text_from_file_with_apath =open('D:\python\ciyun.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-23 13:17  lh459384111  阅读(155)  评论(0编辑  收藏  举报