You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
376 B
8 lines
376 B
2 months ago
|
from imageio.v2 import imread
|
||
|
import wordcloud
|
||
|
|
||
|
#绘制词云图
|
||
|
txt = open('C:\\Users\\86158\\爬虫作业\\ciyuntu.txt','r',encoding='utf-8').read()
|
||
|
w = wordcloud.WordCloud(background_color='white',font_path='c:\\WINDOWS\\Fonts\\simkai.TTF',mask=imread(r'C:\\Users\\86158\\Pictures\\R-C.jpg'))
|
||
|
w.generate(txt)
|
||
|
w.to_file('C:\\Users\\86158\\爬虫作业\\ciyuntu3.png')
|