python - pyecharts Visualization of "a" - Dynamic graphics Advanced [Statistics used Chart - visual feast]

1, pyecharts mounting Introduction

       Baidu is to call the ECharts and python interface. ECharts English word for Enterprise Charts, graphs do business-grade data, is Baidu's open source data visualization tools. We use the python pyecharts library, just a few lines of code to draw a shining picture. It is not hard to learn. Of course, if you do not, then install pyecharts look at my suggestion pyecharts installation guide, full of success! [PS: If you are sure there will be a variety of problems from other sources installed, do not worry my tutorial]
pyecharts Installation Tutorial: Installation unsuccessful me give you a head when the ball
pyecharts official website describes the various parameters
pyecharts official website
if that example click here to see the color does not look good on a color code table, choose your favorite color replacement

2, pyecharts drawing realize anaconda (the picture is dynamic, showing still pictures here)

2.1 Production Instrument - dial map

from pyecharts import Gauge #仪表盘图
gauge = Gauge("仪表盘示例",background_color='#00ffff')
# #00ffff 是图片背景的颜色,如果不知道怎么替换,看制作条形图2
gauge.add("业务指标", "完成率", 66.66)
gauge.render()

Here Insert Picture Description

2.3 Production - bar

from pyecharts import Bar
v1 = [20,25,35,24]
str1 = ['回忆','生活','现实','失败']
# 默认Bar()第一个参数为 主标题,第二个参数为副标题
bar1 = Bar('我的柱状图','Theme', title_color  ='#5599ff',subtitle_color= '#00ffff',
           background_color = '#00ffff',title_pos='center',title_top='5%',)
# background_color 背景颜色 title_top标题距离顶端位置  title_pos标题中心位置
# title_color主标题颜色 subtitle_color副标题颜色 
bar1.add('vintage',str1,v1,is_more_utils = True,is_random=True)
bar1.render() #指定输出位置is_random=True

If you think the color does not look good on Click here to select your favorite color
Here Insert Picture Description

2.4 to create dynamic - Scatter

from pyecharts import EffectScatter
v1 =[10, 20, 30, 40, 50, 60]
v2 =[25, 20, 15, 10, 60, 33]
es =EffectScatter("动态散点图")
es.add("effectScatter", v1, v2)

es =EffectScatter("动态散点图加不同示例",background_color='#00ffff')
es.add("", [10], [10], symbol_size=20, effect_scale=3.5, effect_period=3, symbol="arrow")
es.add("", [30], [30], symbol_size=50, effect_scale=5.5, effect_period=5,symbol="diamond")
es.add("", [40], [40], symbol_size=13, effect_scale=6.5, effect_brushtype='fill',symbol="roundRect")
es.add("", [50], [50], symbol_size=17, effect_scale=5.5, effect_period=3,symbol="triangle")
es.add("", [60], [60], symbol_size=7, effect_scale=2.5, effect_period=3,symbol="pin")
es.render()    #涟漪散点

Here Insert Picture Description

2.5 Dynamic Production - line chart

from pyecharts import Line #折线图
attr =['自营者','主妇','作家','其他','农民','医生']
v1 =[5, 20, 36, 10, 10, 100]
v2 =[55, 60, 16, 20, 15, 80]
line =Line("折线图示例",background_color='#00ffff')
line.add("职位1", attr, v1, mark_point=["average"])
line.add("职位2", attr, v2, is_smooth=True, mark_line=["max", "average"])
line.show_config()
line.render()

Here Insert Picture Description

2.6 Dynamic Production - nuclear density map

from pyecharts import Line  #核密度图
line =Line("折线图-面积示例", background_color='#00ffff')
line.add("职业1", attr, v1, is_fill=True, line_opacity=0.2, area_opacity=0.4, symbol=None)
line.add("职业2", attr, v2, is_fill=True, area_color='#00ffff', area_opacity=0.3, is_smooth=True)
line.show_config()
line.render()

Here Insert Picture Description

2.7 to create dynamic - water polo 1 (can be made to work completion rate: 80%)

from pyecharts import Liquid  #水球1
liquid =Liquid("动态水球",background_color='#00ffff')
liquid.add("Liquid", [0.8],liquid_color='0066ff')
liquid.show_config()
liquid.render()

Here Insert Picture Description

2.8 to create dynamic - Water Polo 2 (can be made to work completion rate: 60%)

from pyecharts import Liquid  #水球2
liquid =Liquid("动态水球",background_color='#00ffff')
liquid.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_outline_show=False) # 指定波浪
liquid.show_config()
liquid.render()

Here Insert Picture Description

2.9 completion rate - shown (can be made completion rate: 70%)

from pyecharts import Liquid #水球3  棱形
liquid =Liquid("水球3",background_color='#00ffff')
liquid.add("Liquid", [0.7, 0.6, 0.5, 0.4], is_liquid_animation=False, shape='arrow')
# 这里的shape可以替换为 散点图里面的shape
liquid.show_config()
liquid.render()

Here Insert Picture Description

3, end the eggs

        It does not tell a story, I list my visual slogan: either helpful! Either interesting!

        Today, here came to an end - here is Jeruser visual feast column, let you experience a different data analysis, how work gets interesting, please continue to focus on me. Thank you for watching me Jetuser-data

Links: [https://blog.csdn.net/L1542334210]
CSND: L1542334210
Here Insert Picture Description
I wish you all success! Family fun!

Published 29 original articles · won praise 53 · views 30000 +

Guess you like

Origin blog.csdn.net/L1542334210/article/details/102678144