Skip to content

Instantly share code, notes, and snippets.

@hamletbatista
Created February 27, 2019 22:09
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 hamletbatista/0dc856ee8f42ae9f8a99a6571222bd85 to your computer and use it in GitHub Desktop.
Save hamletbatista/0dc856ee8f42ae9f8a99a6571222bd85 to your computer and use it in GitHub Desktop.
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
import matplotlib.pyplot as plt
word_cloud = [x[0] for x in cnt.most_common(25)]
word_cloud_obj = WordCloud(max_words=25, background_color="white").generate(" ".join(word_cloud))
#word_cloud_obj = WordCloud().generate(" ".join(word_cloud)) #default with ugly black background
plt.imshow(word_cloud_obj, interpolation='bilinear')
plt.axis("off")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment