Created
February 20, 2016 10:09
-
-
Save satishkt/e395997c57d219e6d4bc 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
from wordcloud import WordCloud | |
wordcloud = WordCloud().generate(text) | |
# Display the generated image: | |
# the matplotlib way: | |
import matplotlib.pyplot as plt | |
plt.imshow(wordcloud) | |
plt.axis("off") | |
# take relative word frequencies into account, lower max_font_size | |
wordcloud = WordCloud(max_font_size=40, relative_scaling=.5).generate(text) | |
plt.figure() | |
plt.imshow(wordcloud) | |
plt.axis("off") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment