Skip to content

Instantly share code, notes, and snippets.

@YHaruoka
Created May 22, 2022 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YHaruoka/6ff3c1080a83e0e5c648c7f4e5199008 to your computer and use it in GitHub Desktop.
Save YHaruoka/6ff3c1080a83e0e5c648c7f4e5199008 to your computer and use it in GitHub Desktop.
from wordcloud import WordCloud
import matplotlib.pyplot as plt
text = open("test.txt",encoding='utf-8').read()
wordcloud = WordCloud(width=1920, height=1080, max_words=200,background_color="white").generate(text)
wordcloud.to_file("word_cloud_result.png")
plt.imshow(wordcloud)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment