File size: 388 Bytes
6f953dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 | import matplotlib.pyplot as plt
from wordcloud import WordCloud
from collections import Counter
def plot_wordcloud(texts, max_words=100):
text = " ".join(texts)
wc = WordCloud(width=800, height=400, background_color="white", max_words=max_words)
wc.generate(text)
plt.figure(figsize=(12,6))
plt.imshow(wc, interpolation='bilinear')
plt.axis('off')
return plt
|