<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
這期文章我們一起來看看地圖是如何繪製的,如何在地圖裡面新增資料進行多維度的展示,下面我們一起來感受一下地圖的魅力吧!
“地圖就是依據一定的數學法則,使用製圖語言,通過製圖綜合,在一定的載體上,表達地球(或其他天體)上各種事物的空間分佈、聯絡及時間中的發展變化狀態的圖形. 地圖的特徵包括:由於特殊的數學法則而產生的可量測性;由於使用符號表象事物而產生的直觀性;由於製圖綜合而產生的一覽性. 地圖的三要素是:比例尺、方向、圖例 地圖學是研究地圖的理論、編制技術與應用方法的科學,是一門研究以地圖圖形反映與揭示各種自然和社會現象空間分佈、相互聯絡及動態變化的科學、技術與藝術相結合的科學.”
讀萬卷書不如行萬里路,讓我們一起看看祖國的大好山河吧!
展示中國的所有省份,一個完全的中國簡單的地理圖形,方便你理解城市的分佈位置喲!
from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.faker import Faker c = ( Map() .add("城市", [list(z) for z in zip(Faker.provinces, Faker.values())], "china") .set_global_opts(title_opts=opts.TitleOpts(title="中國地圖")) .render("中國地圖.html") ) print([list(z) for z in zip(Faker.provinces, Faker.values())])
重慶地圖的展示,新增了區縣的資料即可,快來看看重慶有哪些好玩的地方吧,聽說主城區的洪崖洞還不錯,夜景那是非常好看的,來吧我們一起來看看吧!
from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.faker import Faker x=["巫山縣","萬州區","雲陽縣","奉節縣"] y=[123,560,456,362] c = ( Map(init_opts=opts.InitOpts(width="1400px", height="700px")) .add("城市", [list(z) for z in zip(x,y)], "重慶") .set_global_opts( title_opts=opts.TitleOpts(title="重慶地圖"), visualmap_opts=opts.VisualMapOpts(max_=560) ) .render("重慶地圖.html") )
展示中國省份,提供資料即可,展示分段型的資料按鈕,滑鼠也可以控制喲,快來看看吧!
from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.faker import Faker c = ( Map(init_opts=opts.InitOpts(width="1400px", height="700px")) .add("城市", [list(z) for z in zip(Faker.provinces, Faker.values())], "china") .set_global_opts( title_opts=opts.TitleOpts(title="中國人口地圖)"), visualmap_opts=opts.VisualMapOpts(max_=200, is_piecewise=True), ) .render("中國分段地圖.html") )
需要注意的是我們要知道每個國家英文名字,注意和pyecharts的map()語言一樣,不然就不行了。
這裡提供官方對照表喲,這也太強了吧!
{ "Somalia": "索馬利亞", "Liechtenstein": "列支敦斯登", "Morocco": "摩洛哥", "W. Sahara": "西撒哈拉", "Serbia": "塞爾維亞", "Afghanistan": "阿富汗", "Angola": "安哥拉", "Albania": "阿爾巴尼亞", "Andorra": "安道爾共和國", "United Arab Emirates": "阿拉伯聯合大公國", "Argentina": "阿根廷", "Armenia": "亞美尼亞", "Australia": "澳大利亞", "Austria": "奧地利", "Azerbaijan": "亞塞拜然", "Burundi": "蒲隆地", "Belgium": "比利時", "Benin": "貝南", "Burkina Faso": "布吉納法索", "Bangladesh": "孟加拉國", "Bulgaria": "保加利亞", "Bahrain": "巴林", "Bahamas": "巴哈馬", "Bosnia and Herz.": "波斯尼亞和黑塞哥維那", "Belarus": "白俄羅斯", "Belize": "貝里斯", "Bermuda": "百慕大", "Bolivia": "玻利維亞", "Brazil": "巴西", "Barbados": "巴貝多", "Brunei": "汶萊", "Bhutan": "不丹", "Botswana": "波札那", "Central African Rep.": "中非", "Canada": "加拿大", "Switzerland": "瑞士", "Chile": "智利", "China": "中國", "Côte d'Ivoire": "象牙海岸", "Cameroon": "喀麥隆", "Dem. Rep. Congo": "剛果民主共和國", "Congo": "剛果", "Colombia": "哥倫比亞", "Cape Verde": "維德角", "Costa Rica": "哥斯大黎加", "Cuba": "古巴", "N. Cyprus": "北塞普勒斯", "Cyprus": "塞普勒斯", "Czech Rep.": "捷克", "Germany": "德國", "Djibouti": "吉布提", "Denmark": "丹麥", "Dominican Rep.": "多明尼加", "Algeria": "阿爾及利亞", "Ecuador": "厄瓜多", "Egypt": "埃及", "Eritrea": "厄利垂亞", "Spain": "西班牙", "Estonia": "愛沙尼亞", "Ethiopia": "衣索比亞", "Finland": "芬蘭", "Fiji": "斐濟", "France": "法國", "Gabon": "加彭", "United Kingdom": "英國", "Georgia": "喬治亞", "Ghana": "迦納", "Guinea": "幾內亞", "Gambia": "甘比亞", "Guinea-Bissau": "幾內亞比索", "Eq. Guinea": "赤道幾內亞", "Greece": "希臘", "Grenada": "格瑞那達", "Greenland": "格陵蘭", "Guatemala": "瓜地馬拉", "Guam": "關島", "Guyana": "蓋亞那", "Honduras": "宏都拉斯", "Croatia": "克羅埃西亞", "Haiti": "海地", "Hungary": "匈牙利", "Indonesia": "印度尼西亞", "India": "印度", "Br. Indian Ocean Ter.": "英屬印度洋領土", "Ireland": "愛爾蘭", "Iran": "伊朗", "Iraq": "伊拉克", "Iceland": "冰島", "Israel": "以色列", "Italy": "義大利", "Jamaica": "牙買加", "Jordan": "約旦", "Japan": "日本", "Siachen Glacier": "錫亞琴冰川", "Kazakhstan": "哈薩克", "Kenya": "肯亞", "Kyrgyzstan": "吉爾吉斯坦", "Cambodia": "柬埔寨", "Korea": "韓國", "Kuwait": "科威特", "Lao PDR": "寮國", "Lebanon": "黎巴嫩", "Liberia": "賴比瑞亞", "Libya": "利比亞", "Sri Lanka": "斯里蘭卡", "Lesotho": "賴索托", "Lithuania": "立陶宛", "Luxembourg": "盧森堡", "Latvia": "拉脫維亞", "Moldova": "摩爾多瓦", "Madagascar": "馬達加斯加", "Mexico": "墨西哥", "Macedonia": "馬其頓", "Mali": "馬裡", "Malta": "馬耳他", "Myanmar": "緬甸", "Montenegro": "黑山", "Mongolia": "蒙古", "Mozambique": "莫三比克", "Mauritania": "茅利塔尼亞", "Mauritius": "模里西斯", "Malawi": "馬拉維", "Malaysia": "馬來西亞", "Namibia": "納米比亞", "New Caledonia": "新喀里多尼亞", "Niger": "尼日", "Nigeria": "奈及利亞", "Nicaragua": "尼加拉瓜", "Netherlands": "荷蘭", "Norway": "挪威", "Nepal": "尼泊爾", "New Zealand": "紐西蘭", "Oman": "阿曼", "Pakistan": "巴基斯坦", "Panama": "巴拿馬", "Peru": "祕魯", "Philippines": "菲律賓", "Papua New Guinea": "巴布亞紐幾內亞", "Poland": "波蘭", "Puerto Rico": "波多黎各", "Dem. Rep. Korea": "朝鮮", "Portugal": "葡萄牙", "Paraguay": "巴拉圭", "Palestine": "巴勒斯坦", "Qatar": "卡達", "Romania": "羅馬尼亞", "Russia": "俄羅斯", "Rwanda": "盧安達", "Saudi Arabia": "沙烏地阿拉伯", "Sudan": "蘇丹", "S. Sudan": "南蘇丹", "Senegal": "塞內加爾", "Singapore": "新加坡", "Solomon Is.": "索羅門群島", "Sierra Leone": "獅子山", "El Salvador": "薩爾瓦多", "Suriname": "蘇利南", "Slovakia": "斯洛伐克", "Slovenia": "斯洛維尼亞", "Sweden": "瑞典", "Swaziland": "史瓦濟蘭", "Seychelles": "塞席爾", "Syria": "敘利亞", "Chad": "查德", "Togo": "多哥", "Thailand": "泰國", "Tajikistan": "塔吉克", "Turkmenistan": "土庫曼", "Timor-Leste": "東帝汶", "Tonga": "湯加", "Trinidad and Tobago": "千里達及托巴哥", "Tunisia": "突尼西亞", "Turkey": "土耳其", "Tanzania": "坦尚尼亞", "Uganda": "烏干達", "Ukraine": "烏克蘭", "Uruguay": "烏拉圭", "United States": "美國", "Uzbekistan": "烏茲別克", "Venezuela": "委內瑞拉", "Vietnam": "越南", "Vanuatu": "萬那杜", "Yemen": "葉門", "South Africa": "南非", "Zambia": "尚比亞", "Zimbabwe": "辛巴威", "Aland": "奧蘭群島", "American Samoa": "美屬薩摩亞", "Fr. S. Antarctic Lands": "南極洲", "Antigua and Barb.": "安地卡及巴布達", "Comoros": "葛摩", "Curaçao": "庫拉索島", "Cayman Is.": "開曼群島", "Dominica": "多明尼加", "Falkland Is.": "馬爾維納斯群島(福克蘭)", "Faeroe Is.": "法羅群島", "Micronesia": "密克羅尼西亞", "Heard I. and McDonald Is.": "赫德島和麥克唐納群島", "Isle of Man": "曼島", "Jersey": "澤西島", "Kiribati": "吉里巴斯", "Saint Lucia": "聖露西亞", "N. Mariana Is.": "北馬裡亞納群島", "Montserrat": "蒙特塞拉特", "Niue": "紐埃", "Palau": "帛琉", "Fr. Polynesia": "法屬波利尼西亞", "S. Geo. and S. Sandw. Is.": "南喬治亞島和南桑威奇群島", "Saint Helena": "聖赫勒拿", "St. Pierre and Miquelon": "聖皮埃爾和密克隆群島", "São Tomé and Principe": "聖多美和普林西比", "Turks and Caicos Is.": "特克斯和凱科斯群島", "St. Vin. and Gren.": "聖文森及格瑞那丁", "U.S. Virgin Is.": "美屬維爾京群島", "Samoa": "薩摩亞" }
from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.faker import Faker c = ( Map(init_opts=opts.InitOpts(width="1400px", height="700px")) .add("國家", [list(z) for z in zip(Faker.country, Faker.values())], "world") .set_series_opts(label_opts=opts.LabelOpts(is_show=False)) .set_global_opts( title_opts=opts.TitleOpts(title="世界地圖"), visualmap_opts=opts.VisualMapOpts(max_=200), ) .render("世界地圖.html") )
如果你想要知道中國地圖,但是也要知道祖國的板塊輪廓,可以用這個模板喲!
from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.faker import Faker c = ( Map(init_opts=opts.InitOpts(width="1400px", height="700px")) .add( "城市", [list(z) for z in zip(Faker.guangdong_city, Faker.values())], "china-cities", label_opts=opts.LabelOpts(is_show=False), ) .set_global_opts( title_opts=opts.TitleOpts(title="中國地圖(帶城市)"), visualmap_opts=opts.VisualMapOpts(), ) .render("中國地圖帶城市.html") )
之前的那個模板是分段的,這個是連續的資料地圖,看你在什麼場景進行資料視覺化,有需要的這裡都有喲!
from pyecharts import options as opts from pyecharts.charts import Map from pyecharts.faker import Faker c = ( Map(init_opts=opts.InitOpts(width="1400px", height="700px")) .add("城市", [list(z) for z in zip(Faker.provinces, Faker.values())], "china") .set_global_opts( title_opts=opts.TitleOpts(title="(標題)"), visualmap_opts=opts.VisualMapOpts(max_=200), ) .render("連續資料地圖.html") )
到此這篇關於Python繪製地理圖表視覺化神器pyecharts的文章就介紹到這了,更多相關Python繪製神器pyecharts內容請搜尋it145.com以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援it145.com!
相關文章
<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
综合看Anker超能充系列的性价比很高,并且与不仅和iPhone12/苹果<em>Mac</em>Book很配,而且适合多设备充电需求的日常使用或差旅场景,不管是安卓还是Switch同样也能用得上它,希望这次分享能给准备购入充电器的小伙伴们有所
2021-06-01 09:31:42
除了L4WUDU与吴亦凡已经多次共事,成为了明面上的厂牌成员,吴亦凡还曾带领20XXCLUB全队参加2020年的一场音乐节,这也是20XXCLUB首次全员合照,王嗣尧Turbo、陈彦希Regi、<em>Mac</em> Ova Seas、林渝植等人全部出场。然而让
2021-06-01 09:31:34
目前应用IPFS的机构:1 谷歌<em>浏览器</em>支持IPFS分布式协议 2 万维网 (历史档案博物馆)数据库 3 火狐<em>浏览器</em>支持 IPFS分布式协议 4 EOS 等数字货币数据存储 5 美国国会图书馆,历史资料永久保存在 IPFS 6 加
2021-06-01 09:31:24
开拓者的车机是兼容苹果和<em>安卓</em>,虽然我不怎么用,但确实兼顾了我家人的很多需求:副驾的门板还配有解锁开关,有的时候老婆开车,下车的时候偶尔会忘记解锁,我在副驾驶可以自己开门:第二排设计很好,不仅配置了一个很大的
2021-06-01 09:30:48
不仅是<em>安卓</em>手机,苹果手机的降价力度也是前所未有了,iPhone12也“跳水价”了,发布价是6799元,如今已经跌至5308元,降价幅度超过1400元,最新定价确认了。iPhone12是苹果首款5G手机,同时也是全球首款5nm芯片的智能机,它
2021-06-01 09:30:45