Python 데이터 시각 화 pyecharts 기반 지리 도표 그리 기

1.예:바 이 두 이동
바 이 두 지도 설 인구 이동 빅 데이터(바 이 두 이동 으로 약칭)는 바 이 두 가 2014 년 춘 운 기간 에 내 놓 은 기술 프로젝트 이다.바 이 두 이전 은 빅 데 이 터 를 이용 하여 자신 이 가지 고 있 는 LBS(지리 적 위 치 를 바탕 으로 하 는 서비스)빅 데 이 터 를 계산 분석 하고 시각 화 된 표현 방식 으로 중국 설 전후 인구 대 이동 의 궤적 과 특징 을 동태 적 이 고 실시 간 이 며 직관 적 으로 보 여 준다.
사이트 주소:https://qianxi.baidu.com/2021/

기초 문법 소개
문법
설명 하 다.
from pyecharts.charts import Geo
지도 라 이브 러 리 가 져 오기
Geo()
Pyecharts 지리 도표 그리 기
.add_map(maptype=“china“)
지도 종류
.add()
데이터 추가
.set_global_opts()
전역 설정 항목 설정
3.중국 지도 제작
인 스 턴 스 코드:

from pyecharts.charts import Geo
import pyecharts.options as opts
from commons import Faker
 
(
    Geo()
    .add_schema(maptype='china')    #          
    .add(series_name='', data_pair=[(i, j) for i, j in zip(Faker.provinces, Faker.values())])
    .set_global_opts(
        title_opts=opts.TitleOpts(title='    '),
        visualmap_opts=opts.VisualMapOpts(
#             is_piecewise=True   #       
        )
    )
).render()

실행 결과:

4.중국 지도(특수효과 산포도)
인 스 턴 스 코드:

from pyecharts.charts import Geo
import pyecharts.options as opts
from pyecharts.globals import ChartType
from commons import Faker
 
(
    Geo()
    .add_schema(maptype='china')     #          
    .add(series_name='', data_pair=[(i, j) for i, j in zip(Faker.provinces, Faker.values())],
        type_=ChartType.EFFECT_SCATTER)
    .set_global_opts(
        title_opts=opts.TitleOpts(title='    (     )'),
        visualmap_opts=opts.VisualMapOpts(
            is_piecewise=True
        )
    )
).render()
실행 결과:

5.중국 인구 지리 이동 도 그리 기
 인 스 턴 스 코드:

from pyecharts.charts import Geo
from pyecharts.globals import ChartType, SymbolType
import pyecharts.options as opts
 
#     (    )
city_num = [('  ', 105), ('  ', 70), ('  ', 99), ('  ', 80)]
start_end = [('  ', '  '), ('  ', '  '), ('  ', '  ')]
 
(
    Geo()
    .add_schema(maptype='china', itemstyle_opts=opts.ItemStyleOpts(color='#323c48', border_color='#111'))   #       
    .add('', data_pair=city_num, color='white')    #         ( )
    .add('', data_pair=start_end, type_=ChartType.LINES,   #    
         effect_opts=opts.EffectOpts(symbol=SymbolType.ARROW,color='blue', symbol_size=7))   #       
).render()
실행 결과:

6.열력 도:광동 지도 열력 도 그리 기 1
인 스 턴 스 코드:

from pyecharts.faker import Faker
from pyecharts import options as opts
from pyecharts.charts import Geo
from pyecharts.globals import ChartType
 
c = (
    Geo()
    .add_schema(maptype="  ", itemstyle_opts=opts.ItemStyleOpts(color="#323c48", border_color="#111"),)
    .add("",[list(z) for z in zip(Faker.guangdong_city, Faker.values())],type_=ChartType.HEATMAP)
    .set_global_opts(
        visualmap_opts=opts.VisualMapOpts(),
        title_opts=opts.TitleOpts(title="       "),
    )
)
 
c.render()
실행 결과:

7.열력 도:광동 지도 열력 도 그리 기 2
 인 스 턴 스 코드:

from pyecharts.charts import Map
from pyecharts import options as opts
from pyecharts.globals import ChartType
 
c = (
    Map()
    .add('', [list(z) for z in zip(Faker.guangdong_city, Faker.values())], "  ")
    .set_global_opts(
        title_opts=opts.TitleOpts(title="Map-    "),
        visualmap_opts=opts.VisualMapOpts(),
    )
)
 
c.render()
실행 결과:

파 이 썬 데이터 시각 화 에 관 한 pyecharts 기반 지리 도표 그리 기 에 관 한 글 은 여기까지 입 니 다.더 많은 관련 pyecharts 지리 도표 그리 기 내용 은 우리 의 이전 글 을 검색 하거나 아래 의 관련 글 을 계속 조회 하 시기 바 랍 니 다.앞으로 많은 관심 을 가 져 주 십시오!

좋은 웹페이지 즐겨찾기