[c09aa8]: / clusters / scripts / wordclouds2.py

Download this file

25 lines (21 with data), 941 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
import matplotlib.pyplot as plt
from wordcloud import WordCloud
for j in [5, 10, 54, 56, 65, 91, 143, 232, 243] :
f1 = open("C:/Users/Neil Malur/Downloads/platelets-20181031T164756Z-001/platelets/platelet-clust_" + str(j) + ".txt", 'r')
texts = f1.readlines()
text = ""
for t in texts :
text = text + " " + t
wordcloud = WordCloud().generate(text)
plt.axis("off")
plt.imshow(wordcloud, interpolation="bilinear")
plt.savefig("C:/primes/data/megaclouds/cloud_" + str(j) + ".pdf", bbox_inches='tight')
f1 = open("C:/Users/Neil Malur/Downloads/platelets-20181031T164756Z-001/platelets/platelet-clust_all.txt", 'r')
texts = f1.readlines()
text = ""
for t in texts :
text = text + " " + t
wordcloud = WordCloud().generate(text)
plt.axis("off")
plt.imshow(wordcloud, interpolation="bilinear")
plt.savefig("C:/primes/data/megaclouds/cloud_all.pdf", bbox_inches='tight')