Get the App
SLTechnology News&Howtos  ›  Development  › 

How to make word Cloud Picture with pyecharts in python

Shulou Source: shulou.com Published: 2022-06-02 00:32:37 09月28日 Update

This article is about how Python uses pyecharts to create word clouds. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

Pyecharts needs to be installed

pip install pyecharts -U

Create [demo6.py] and enter the following code:

from pyecharts import options as optsfrom pyecharts.charts import Page, WordCloud words = [ ("Miracle Doctor", 10000), ("Ma Liang", 6181); ("Mary," 4386), (Terminator, 4055), ("Blue Star," 2467), (Wisdom, 2244); ("Military Industry," 1868), ("Blood Spot," 1281)] def wordcloud_base() -> WordCloud: c = ( WordCloud() .add("", words, word_size_range=[20, 100]) .set_global_opts(title_opts=opts.TitleOpts(title="Basic Examples")) ) return c wd = wordcloud_base()wd.render("word_demo.html")

click the execute

Open the generated html file

double-click to open

The renderings are as follows:

Thank you for reading! About "python how to use pyecharts to make word cloud map" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Tags: Cloud images production content more articles good practical military Huixin effects effect drawings files articles see knowledge examples doctor Terminator coding Mary Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn MySQL Shulou Information Redmi