Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from wordcloud import WordCloud
- import matplotlib.pyplot as plt
- from os import path
- d = path.dirname(__file__) if "__file__" in locals() else os.getcwd()
- text_standard = open(fpath + '/Plutarch_tokens.txt', 'rt').read()
- wc = WordCloud(stopwords=stop_words,
- max_font_size=200,
- width=2500,
- height=2000,
- max_words=4000,
- random_state=44,
- ).generate(text_standard)
- wc.to_file(path.join(d, "wc.png")) #comment out if no need to store the png
- fig = plt.figure().set_size_inches(18, 18)
- plt.imshow(wc, interpolation="bilinear")
- plt.axis("off")
- plt.title("Plutarch's Lives", fontsize= 20)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement