Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. from wordcloud import WordCloud
  2.  
  3. def wordcloud(counter):
  4. """A small wordloud wrapper"""
  5. wc = WordCloud(width=1200, height=800,
  6. background_color="white",
  7. max_words=200)
  8. wc.generate_from_frequencies(counter)
  9.  
  10. # Plot
  11. fig=plt.figure(figsize=(6, 4))
  12. plt.imshow(wc, interpolation='bilinear')
  13. plt.axis("off")
  14. plt.tight_layout(pad=0)
  15. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement