Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Last active May 5, 2022
Embed
What would you like to do?
##### Generate the wordcloud #####
my_freq_grams = freq_grams
curMask = np.array(Image.open(pathToYourPic))
wc = WordCloud(background_color='white',
stopwords=stopwords,
width=800,
height=600,
relative_scaling=.6,
max_font_size=60,
random_state=1234,
mask=curMask,
colormap=plt.cm.plasma
).generate_from_frequencies(my_freq_grams)
## create color
plt.figure(figsize=[15,15])
plt.imshow(wc, interpolation='bilinear')
plt.title('WordCloud - Game/Animation', fontsize = 'xx-large')
plt.axis('off')
plt.tight_layout(pad=0)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment