代码
from wordcloud import WordCloud
import matplotlib.pyplot as plt
f = open('../txt/wordcloud.txt', 'r').read()
wordcloud = WordCloud(background_color="white",width=1000,height=860,margin=2).generate(f)
plt.imshow(wordcloud)
plt.axis("off")
plt.show()
wordcloud.to_file('../picture/example1.png')
© 著作权归作者所有
举报
相关热门文章
发表评论
0/200