Last active
May 5, 2022 22:00
-
-
Save YiLi225/e17d179639ba6a08e006ed17f7aaec6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### 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