In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to make a cool rolling earth with python". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use python to make a cool rolling earth".
The method is relatively simple, first install the pyecharts==1.7.1 version, and under the jupyter notebook editor, enter the following code:
Import pyecharts.options as opts from pyecharts.charts import MapGlobe from pyecharts.faker import POPULATION data = [x for _, x in policy [1:]] low, high = min (data), max (data) c = (MapGlobe (init_opts=opts.InitOpts ()) .add _ schema () .add (maptype= "world", series_name= "World Population", data_pair=POPULATION [1:], is_map_symbol_show=False Label_opts=opts.LabelOpts (is_show=False),) .set _ global_opts (visualmap_opts=opts.VisualMapOpts (min_=low, max_=high, range_text= ["max", "min"], is_calculable=True, is_piecewise=True, range_color= ["lightskyblue", "yellow", "orangered"] )) c.render_notebook ()
In order to be able to make the earth you like, here is a detailed introduction to the meaning of the key parameters:
1.POPULATION
What is imported is the population of countries around the world, so different colors on the earth represent the number of people in each country, and you can also import other data according to your preferences.
2.theme
You can import different topics, and the topic types are as follows:
Themes = [('chalk',' chalk style'), ('dark',' Dark Wind'), ('essos',' Essos mainland'), ('infographic',' infographic'), ('light',' bright style'), ('macarons',' macaron'), ('purple-passion',' purple passion'), ('roma',' pomegranate'), ('romantic'') 'romantic wind'), ('shine',' sparkling wind'), ('vintage',' retro wind'), ('walden',' Walden'), ('westeros',' Westeros continent'), ('white',' white wind'), ('wonderland',' Wonderland')]
Change the dark wind to the earth:
3.LabelOpts
Display the map label, change False to True, and the name of the country is displayed, as shown below:
4.maptype
Change the map range, change world to china;, or make a map of the earth that shows only Beijing and other provinces and cities.
Thank you for your reading, the above is the content of "how to make a cool rolling earth with python". After the study of this article, I believe you have a deeper understanding of how to use python to make a cool rolling earth, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.