How to create tag clouds

[ ]

wordcloud

The most simple way is to use a Python package wordcloud. Then you can generate a word cloud with the following code:

from wordcloud import WordCloud
import matplotlib.pyplot as plt
wc = WordCloud()
text = open(r"222.txt",encoding='utf-8').read()
wc.generate(text)
plt.imshow(wc)

This is the example:

Django service

There is a free service in 词云助手 let you generate a tag cloud and you can even specify the image for the cloud. For example, with this as background:

We can get

Written on September 20, 2017