create a interactive 3D global with pyecharts

  1. pip install pyecharts
  2. write earth.py as below:
import pyecharts.options as opts
from pyecharts.charts import MapGlobe
from pyecharts.faker import POPULATION
  
data = [x for _, x in POPULATION[1:]]
low, high = min(data), max(data)
c = (
MapGlobe(init_opts=opts.InitOpts(width='300px', height='300px',bg_color='#FFFAFA',))
.add_schema()
.add(
maptype="world",
series_name="World Population",
data_pair=POPULATION[1:],
is_map_symbol_show=True,
label_opts=opts.LabelOpts(is_show=True),
)
.set_global_opts(
title_opts=opts.TitleOpts(title="3D Global"),

visualmap_opts=opts.VisualMapOpts(
min_=low,
max_=high,
range_text=["max", "min"],
is_calculable=True,
range_color=["lightskyblue", "yellow", "orangered"],
)
)
.render("world_map_3d.html")
)

3. python earth.py, it will generate world_map_3d.html file, open it in browser:

Awesome-pyecharts

12 Replies to “create a interactive 3D global with pyecharts”

  1. Hullo there, just started to be aware about your web page through The Big G, and found that it is really informative. I will be grateful should you continue this idea. Saidee Cyril Torruella

  2. Hello! This is my first comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your blog posts. Can you recommend any other blogs/websites/forums that go over the same subjects? Thank you! Bryn Consalve Olenta

  3. We stumbled over here from a different web address and thought I may as well check things out. I like what I see so now i am following you. Look forward to looking over your web page again. Jasmin Roddie Mirabelle

  4. Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but instead of that, this is wonderful blog. A fantastic read. I will definitely be back. Dorothea Cobb Krystyna

  5. Great blog here! Also your web site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my site loaded up as fast as yours lol Rafaelita Kingston Kendre

  6. Hey there. I found your site by way of Google while looking for a related matter, your site got here up. It appears to be great. I have bookmarked it in my google bookmarks to visit then. Sabrina Calhoun Melania

  7. I was very happy to discover this page. I want to to thank you for ones time just for this fantastic read!! I definitely really liked every little bit of it and i also have you saved as a favorite to look at new things on your blog. Flor Rowney Justine

Leave a Reply

Your email address will not be published. Required fields are marked *