-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordcloud_mod-plot.py
More file actions
29 lines (24 loc) · 873 Bytes
/
wordcloud_mod-plot.py
File metadata and controls
29 lines (24 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wordcloud import WordCloud
import matplotlib.pyplot as plt
textwc = ""
with open('hive.txt', encoding='utf-8') as f:
textwc = ''.join(f.readlines())
wordcloud = WordCloud(font_path = None,
width = 4000,
height = 2000,
mask = None,
color_func = None,
max_words = 300,
min_font_size = 12,
stopwords = None,
background_color = "white",
max_font_size = 300,
colormap = "gist_heat",
contour_width = 0,
contour_color = "white")
wordcloud.generate(textwc)
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()