python - pyecharts map, map markers visualization to achieve "four" - map visualization [visual feast]

1 Introduction

       In the data analysis, sometimes we would very much hope that the data displayed on the map, do data visualization, data enable more clarity, described as a view of Assab text. Let us talk about what I do with the map: the provinces tourism accounting, data display box office provinces, the country's population migrated schematic and so on. Many will not say, let's take a look at how Python is to achieve echarts and draw a map of it! [PS graphics are dynamic and static display here]
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 is an example of the color does not look good on Click here to see color code table, choose their favorite color replacement

2, pyecharts draw a map

2.1, dynamic map marker

from pyecharts import Geo #地图标点
data =[ ("毕节", 9),("鄂尔多斯", 12),("招远", 12),("舟山", 12),
       ("齐齐哈尔", 14),("昌吉", 15), ("赤峰", 16),("西宁市", 18),
       ("乳山", 18),("西宁", 19),("泉州", 21),("莱西", 21), 
       ("日照", 21),("六盘水", 9),("南通", 23),("通辽", 24),("云浮", 24),
       ("梅州", 25),('拉萨',23)]
geo =Geo("全国主要城市空气质量", title_color="#00ffff", #可以再加一个副标题
         title_pos="center",title_top='5%',width=1000, height=540, background_color='#000000')
attr,value =geo.cast(data)
geo.add("", attr, value, visual_range=[0, 200], visual_text_color="#00ffff",
        symbol_size=45, is_visualmap=False,label_color=["#00ffff"],border_color='#9900ff',
       geo_normal_color='#5555ff',geo_emphasis_color='#0000ff',mark_point_symbol='roundRect') # label_color修改标记颜色
# symbol_size标点大小   is_visualmap是否显示可拖动的图标is_datazoom_show=True用在坐标系里面
# border_color 地图边界颜色  geo_normal_color地图区域的颜色geo_emphasis_color高亮下颜色
geo.show_config()
geo.render()

Here Insert Picture Description

2.2, the ripples moving the map marker

from pyecharts import Geo  #地图涟漪标点
data =[ ("毕节", 23),("鄂尔多斯", 12),("招远", 12),("舟山", 12),
       ("齐齐哈尔", 14),("昌吉", 15), ("赤峰", 16),("西宁市", 18),
       ("乳山", 18),("西宁", 19),("泉州", 21),("莱西", 21), 
       ("日照", 21),("六盘水", 30),("南通", 23),("通辽", 24),("云浮", 24),
       ("梅州", 25),('拉萨',23)]
geo =Geo("全国各城市观影量","数据虚构" ,title_color="#00ffff", #可以再加一个副标题
         title_pos="center",title_top='5%',width=1000, height=540, background_color='#000000')
geo.add("", attr, value, visual_range=[0, 200], visual_text_color="#00ffff",
        symbol_size=45, is_visualmap=False,label_color=["#00ffff"],border_color='#9900ff',
       geo_normal_color='#5555ff',geo_emphasis_color='#0000ff',
        type="effectScatter", effect_scale=6)
   # effect_scale : 涟漪大小 type :涟漪的地图显示 目前只有这种
attr, value =geo.cast(data)
geo.show_config()
geo.render()

Here Insert Picture Description

2.3, pyecharts draw maps of the country (draggable zoom)

from pyecharts import Map  #简易地图  贵州
value =[]
attr =[]
maps=Map("全国地图示例",title_pos="center",title_top='2%', title_color="#00ffff",
         width=1000, height=540,background_color='#000000')
maps.add("", attr, value, maptype='china', is_visualmap=True, visual_text_color='#00ffff',
        geo_normal_color='#5555ff',geo_emphasis_color='#0000ff')
# is_roam :是否可以拖动放缩  is_map_symbol_show 是否在定义的直辖市标记红点
maps.show_config()
maps.render()

Here Insert Picture Description

2.4, draw a map pyecharts Guizhou Province (draggable zoom)

from pyecharts import Map  #简易地图  贵州
value =[20, 190, 253, 77, 65,20, 190]
attr =['毕节市', '六盘水市', '贵阳市', '同仁市', '安顺市','遵义市','黔东南']
maps=Map("贵州地图示例",title_pos="center",title_top='2%', title_color="#00ffff",
         width=1000, height=540,background_color='#000000')
maps.add("", attr, value, maptype='贵州', is_visualmap=True, visual_text_color='#00ffff',
        geo_normal_color='#5555ff',geo_emphasis_color='#0000ff')
# is_roam :是否可以拖动放缩  is_map_symbol_show 是否在定义的直辖市标记红点  maptype选择地图省份
maps.show_config()
maps.render()

       [Ps] by this method can draw any of the provinces map
Here Insert Picture Description

3, end the eggs

        Focus! Focus! Next is the interface for the R language calling echart maps and map visualization migration. Do not go away! I continued to shout slogans visualization: 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/102684253