forked from shibing624/python-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordcloud_demo.py
More file actions
19 lines (18 loc) · 795 Bytes
/
wordcloud_demo.py
File metadata and controls
19 lines (18 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
"""
@author:XuMing([email protected])
@description:
"""
from pyecharts import WordCloud
name_list = ['Sam S Club', 'Macys', 'Amy Schumer', 'Jurassic World',
'Charter Communications','Chick Fil A', 'Planet Fitness',
'Pitch Perfect', 'Express','Home', 'Johnny Depp',
'Lena Dunham', 'Lewis Hamilton', 'KXAN', 'Mary EllenMark',
'Farrah Abraham','Rita Ora', 'Serena Williams',
'NCAA baseball tournament','Point Break']
value_list = [10000, 6181, 4386, 4055, 2467, 2244,
1898, 1484, 1112,965, 847, 582, 555,
550, 462, 366, 360, 282, 273, 265]
wordcloud = WordCloud(width=800, height=500)
wordcloud.add("", name_list, value_list, word_size_range=[20, 100])
wordcloud.render("wordcloud.html")