Skip to content

Instantly share code, notes, and snippets.

@izikeros
Created November 15, 2019 09:44
Show Gist options
  • Save izikeros/fca85e2d7b9eae3e0d9dec6a1f1635b3 to your computer and use it in GitHub Desktop.
Save izikeros/fca85e2d7b9eae3e0d9dec6a1f1635b3 to your computer and use it in GitHub Desktop.
Plot wordcloud from dict in Python
from wordcloud import WordCloud
wordcloud = WordCloud(background_color='white',
width=1500,
height=1000
).generate_from_frequencies(dictionary)
# use .generate(space_separated_string) - to generate cloud from text
plt.figure(figsize=(9,6))
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