From 12e1985b16a0f476935795520433941337fa89a5 Mon Sep 17 00:00:00 2001 From: py6qo2c5g <457171044@qq.com> Date: Wed, 18 Sep 2024 19:32:17 +0800 Subject: [PATCH] ADD file via upload --- 5.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 5.py diff --git a/5.py b/5.py new file mode 100644 index 0000000..001700f --- /dev/null +++ b/5.py @@ -0,0 +1,11 @@ +from wordcloud import WordCloud +import matplotlib.pyplot as plt + + +def make_wordcloud(count_dict): + wc = WordCloud(background_color='white', width=800, height=600) + text = " ".join([keyword + " " * count for keyword, count in count_dict.items()]) + wc.generate(text) + plt.imshow(wc, interpolation='bilinear') + plt.axis('off') + plt.show()