Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from wordcloud import WordCloud
- import matplotlib.pyplot as plt
- filename = 'chapters.html'
- with open(filename) as f:
- text = f.read()
- image = WordCloud(width=1920, height=1080, max_font_size=120, colormap='Spectral').generate(text)
- image.to_file('/tmp/wordcloud.png')
- plt.imshow(image, interpolation='bilinear')
- plt.axis('off')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement