{"id":1180546,"date":"2025-01-15T18:38:09","date_gmt":"2025-01-15T10:38:09","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1180546.html"},"modified":"2025-01-15T18:38:14","modified_gmt":"2025-01-15T10:38:14","slug":"python%e5%a6%82%e4%bd%95%e7%bb%98%e5%88%b6%e4%b8%ad%e5%9b%bd%e5%9c%b0%e5%9b%be","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1180546.html","title":{"rendered":"python\u5982\u4f55\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25125225\/1bc92aec-9acb-4af2-a373-eb3e6ccd7847.webp\" alt=\"python\u5982\u4f55\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\" \/><\/p>\n<p><p> <strong>Python \u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Basemap\u5e93\u3001\u4f7f\u7528Geopandas\u5e93\u3001\u4f7f\u7528Pyecharts\u5e93\u3001\u4f7f\u7528Folium\u5e93\u3002<\/strong> \u5176\u4e2d\uff0c\u4f7f\u7528Pyecharts\u5e93\u662f\u6bd4\u8f83\u7b80\u5355\u4e14\u529f\u80fd\u4e30\u5bcc\u7684\u4e00\u79cd\u65b9\u6cd5\u3002Pyecharts\u662f\u4e00\u4e2a\u7528\u4e8e\u751f\u6210Echarts\u56fe\u8868\u7684Python\u5e93\uff0c\u652f\u6301\u591a\u79cd\u56fe\u8868\u7c7b\u578b\uff0c\u5176\u4e2d\u5c31\u5305\u62ec\u5730\u56fe\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Pyecharts\u5e93\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5\u4e0e\u914d\u7f6e<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u76f8\u5173\u7684Python\u5e93\u3002\u9996\u5148\u662fPyecharts\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pyecharts<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6b64\u5916\uff0c\u5982\u679c\u60a8\u9700\u8981\u66f4\u8be6\u7ec6\u7684\u5730\u7406\u6570\u636e\uff0c\u53ef\u4ee5\u5b89\u88c5 <code>pyecharts_snapshot<\/code> \u4ee5\u4fbf\u66f4\u597d\u5730\u4fdd\u5b58\u56fe\u8868\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pyecharts_snapshot<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u57fa\u7840\u5730\u56fe\u7ed8\u5236<\/h3>\n<\/p>\n<p><h4>1\u3001\u7ed8\u5236\u7b80\u5355\u7684\u4e2d\u56fd\u5730\u56fe<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u6765\u7ed8\u5236\u4e00\u5f20\u7b80\u5355\u7684\u4e2d\u56fd\u5730\u56fe\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 <code>Map<\/code> \u7c7b\uff0c\u5e76\u6307\u5b9a\u5730\u56fe\u7c7b\u578b\u4e3a <code>china<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Map<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>map = Map()<\/p>\n<h2><strong>\u6dfb\u52a0\u4e2d\u56fd\u5730\u56fe\u6570\u636e<\/strong><\/h2>\n<p>map.add(&quot;&quot;, [(&quot;\u5317\u4eac\u5e02&quot;, 1), (&quot;\u4e0a\u6d77\u5e02&quot;, 1), (&quot;\u5e7f\u4e1c\u7701&quot;, 1)], &quot;china&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\u9879<\/strong><\/h2>\n<p>map.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u4e2d\u56fd\u5730\u56fe\u793a\u4f8b&quot;),<\/p>\n<p>    visualmap_opts=opts.VisualMapOpts(max_=200),<\/p>\n<p>)<\/p>\n<h2><strong>\u6e32\u67d3\u5730\u56fe<\/strong><\/h2>\n<p>map.render(&quot;china_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6dfb\u52a0\u7701\u4efd\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u5728\u5730\u56fe\u4e0a\u6dfb\u52a0\u66f4\u591a\u7684\u7701\u4efd\u6570\u636e\uff0c\u5e76\u8bbe\u7f6e\u4e0d\u540c\u7684\u989c\u8272\u8868\u793a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Map<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>map = Map()<\/p>\n<h2><strong>\u6dfb\u52a0\u4e2d\u56fd\u5730\u56fe\u6570\u636e<\/strong><\/h2>\n<p>data = [(&quot;\u5317\u4eac\u5e02&quot;, 100), (&quot;\u4e0a\u6d77\u5e02&quot;, 200), (&quot;\u5e7f\u4e1c\u7701&quot;, 300), (&quot;\u56db\u5ddd\u7701&quot;, 400), (&quot;\u6d59\u6c5f\u7701&quot;, 500)]<\/p>\n<p>map.add(&quot;&quot;, data, &quot;china&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\u9879<\/strong><\/h2>\n<p>map.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u4e2d\u56fd\u7701\u4efd\u5730\u56fe&quot;),<\/p>\n<p>    visualmap_opts=opts.VisualMapOpts(max_=500),<\/p>\n<p>)<\/p>\n<h2><strong>\u6e32\u67d3\u5730\u56fe<\/strong><\/h2>\n<p>map.render(&quot;china_province_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u7ec6\u5316\u5730\u56fe\u7ed8\u5236<\/h3>\n<\/p>\n<p><h4>1\u3001\u7ed8\u5236\u7701\u4efd\u5730\u56fe<\/h4>\n<\/p>\n<p><p>\u9664\u4e86\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u7ed8\u5236\u67d0\u4e2a\u7701\u4efd\u7684\u8be6\u7ec6\u5730\u56fe\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u5e7f\u4e1c\u7701\u5730\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Map<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>map = Map()<\/p>\n<h2><strong>\u6dfb\u52a0\u5e7f\u4e1c\u7701\u5730\u56fe\u6570\u636e<\/strong><\/h2>\n<p>data = [(&quot;\u5e7f\u5dde\u5e02&quot;, 100), (&quot;\u6df1\u5733\u5e02&quot;, 200), (&quot;\u73e0\u6d77\u5e02&quot;, 300), (&quot;\u6c55\u5934\u5e02&quot;, 400), (&quot;\u4f5b\u5c71\u5e02&quot;, 500)]<\/p>\n<p>map.add(&quot;&quot;, data, &quot;\u5e7f\u4e1c&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\u9879<\/strong><\/h2>\n<p>map.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u5e7f\u4e1c\u7701\u5730\u56fe&quot;),<\/p>\n<p>    visualmap_opts=opts.VisualMapOpts(max_=500),<\/p>\n<p>)<\/p>\n<h2><strong>\u6e32\u67d3\u5730\u56fe<\/strong><\/h2>\n<p>map.render(&quot;guangdong_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6dfb\u52a0\u81ea\u5b9a\u4e49\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u5728\u5730\u56fe\u4e0a\u6dfb\u52a0\u81ea\u5b9a\u4e49\u7684\u6570\u636e\uff0c\u5e76\u901a\u8fc7\u989c\u8272\u533a\u5206\u4e0d\u540c\u7684\u533a\u57df\u3002\u4f8b\u5982\uff0c\u6dfb\u52a0\u75ab\u60c5\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Map<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>map = Map()<\/p>\n<h2><strong>\u6dfb\u52a0\u4e2d\u56fd\u5730\u56fe\u6570\u636e<\/strong><\/h2>\n<p>data = [(&quot;\u5317\u4eac\u5e02&quot;, 10), (&quot;\u4e0a\u6d77\u5e02&quot;, 20), (&quot;\u5e7f\u4e1c\u7701&quot;, 30), (&quot;\u56db\u5ddd\u7701&quot;, 40), (&quot;\u6d59\u6c5f\u7701&quot;, 50)]<\/p>\n<p>map.add(&quot;&quot;, data, &quot;china&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\u9879<\/strong><\/h2>\n<p>map.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u4e2d\u56fd\u75ab\u60c5\u5730\u56fe&quot;),<\/p>\n<p>    visualmap_opts=opts.VisualMapOpts(max_=50),<\/p>\n<p>)<\/p>\n<h2><strong>\u6e32\u67d3\u5730\u56fe<\/strong><\/h2>\n<p>map.render(&quot;china_covid_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u8fdb\u9636\u7ed8\u5236\u6280\u5de7<\/h3>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528Geopandas\u7ed8\u5236\u5730\u56fe<\/h4>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528Pyecharts\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528Geopandas\u5e93\u6765\u7ed8\u5236\u66f4\u4e3a\u590d\u6742\u7684\u5730\u56fe\u3002Geopandas\u662f\u4e00\u4e2a\u7528\u4e8e\u5730\u7406\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u7684Python\u5e93\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u5b83\u6765\u8bfb\u53d6\u548c\u7ed8\u5236Shapefile\u683c\u5f0f\u7684\u5730\u56fe\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import geopandas as gpd<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6\u4e2d\u56fd\u5730\u56feShapefile\u6570\u636e<\/strong><\/h2>\n<p>china = gpd.read_file(&quot;china_shapefile.shp&quot;)<\/p>\n<h2><strong>\u7ed8\u5236\u5730\u56fe<\/strong><\/h2>\n<p>fig, ax = plt.subplots(1, 1, figsize=(10, 10))<\/p>\n<p>china.plot(ax=ax, color=&#39;white&#39;, edgecolor=&#39;black&#39;)<\/p>\n<h2><strong>\u663e\u793a\u5730\u56fe<\/strong><\/h2>\n<p>plt.title(&quot;\u4e2d\u56fd\u5730\u56fe&quot;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528Folium\u7ed8\u5236\u4ea4\u4e92\u5f0f\u5730\u56fe<\/h4>\n<\/p>\n<p><p>Folium\u662f\u4e00\u4e2a\u7528\u4e8e\u751f\u6210\u4ea4\u4e92\u5f0f\u5730\u56fe\u7684Python\u5e93\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Folium\u6765\u521b\u5efa\u4ea4\u4e92\u5f0f\u7684\u4e2d\u56fd\u5730\u56fe\uff0c\u5e76\u5728\u5730\u56fe\u4e0a\u6dfb\u52a0\u6807\u8bb0\u548c\u56fe\u5c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import folium<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>m = folium.Map(location=[35.8617, 104.1954], zoom_start=4)<\/p>\n<h2><strong>\u6dfb\u52a0\u6807\u8bb0<\/strong><\/h2>\n<p>folium.Marker([39.9042, 116.4074], popup=&quot;\u5317\u4eac\u5e02&quot;).add_to(m)<\/p>\n<p>folium.Marker([31.2304, 121.4737], popup=&quot;\u4e0a\u6d77\u5e02&quot;).add_to(m)<\/p>\n<p>folium.Marker([23.1291, 113.2644], popup=&quot;\u5e7f\u5dde\u5e02&quot;).add_to(m)<\/p>\n<h2><strong>\u663e\u793a\u5730\u56fe<\/strong><\/h2>\n<p>m.save(&quot;china_folium_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5e94\u7528\u5b9e\u4f8b<\/h3>\n<\/p>\n<p><h4>1\u3001\u7ed8\u5236\u4e2d\u56fd\u5404\u7701GDP\u6570\u636e\u5730\u56fe<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u5229\u7528Pyecharts\u7ed8\u5236\u4e2d\u56fd\u5404\u7701\u7684GDP\u6570\u636e\u5730\u56fe\uff0c\u5e76\u901a\u8fc7\u989c\u8272\u6df1\u6d45\u6765\u8868\u793aGDP\u7684\u9ad8\u4f4e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Map<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>map = Map()<\/p>\n<h2><strong>\u6dfb\u52a0\u4e2d\u56fd\u5404\u7701GDP\u6570\u636e<\/strong><\/h2>\n<p>gdp_data = [(&quot;\u5317\u4eac\u5e02&quot;, 36102), (&quot;\u4e0a\u6d77\u5e02&quot;, 38700), (&quot;\u5e7f\u4e1c\u7701&quot;, 107671), (&quot;\u56db\u5ddd\u7701&quot;, 48598), (&quot;\u6d59\u6c5f\u7701&quot;, 61087)]<\/p>\n<p>map.add(&quot;&quot;, gdp_data, &quot;china&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\u9879<\/strong><\/h2>\n<p>map.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u4e2d\u56fd\u5404\u7701GDP\u6570\u636e&quot;),<\/p>\n<p>    visualmap_opts=opts.VisualMapOpts(max_=110000),<\/p>\n<p>)<\/p>\n<h2><strong>\u6e32\u67d3\u5730\u56fe<\/strong><\/h2>\n<p>map.render(&quot;china_gdp_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u7ed8\u5236\u4e2d\u56fd\u5404\u7701\u4eba\u53e3\u5bc6\u5ea6\u5730\u56fe<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u5229\u7528Pyecharts\u7ed8\u5236\u4e2d\u56fd\u5404\u7701\u7684\u4eba\u53e3\u5bc6\u5ea6\u5730\u56fe\uff0c\u5e76\u901a\u8fc7\u989c\u8272\u6df1\u6d45\u6765\u8868\u793a\u4eba\u53e3\u5bc6\u5ea6\u7684\u9ad8\u4f4e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pyecharts.charts import Map<\/p>\n<p>from pyecharts import options as opts<\/p>\n<h2><strong>\u521b\u5efa\u5730\u56fe\u5bf9\u8c61<\/strong><\/h2>\n<p>map = Map()<\/p>\n<h2><strong>\u6dfb\u52a0\u4e2d\u56fd\u5404\u7701\u4eba\u53e3\u5bc6\u5ea6\u6570\u636e<\/strong><\/h2>\n<p>population_density_data = [(&quot;\u5317\u4eac\u5e02&quot;, 1318), (&quot;\u4e0a\u6d77\u5e02&quot;, 3819), (&quot;\u5e7f\u4e1c\u7701&quot;, 624), (&quot;\u56db\u5ddd\u7701&quot;, 179), (&quot;\u6d59\u6c5f\u7701&quot;, 532)]<\/p>\n<p>map.add(&quot;&quot;, population_density_data, &quot;china&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5168\u5c40\u914d\u7f6e\u9879<\/strong><\/h2>\n<p>map.set_global_opts(<\/p>\n<p>    title_opts=opts.TitleOpts(title=&quot;\u4e2d\u56fd\u5404\u7701\u4eba\u53e3\u5bc6\u5ea6&quot;),<\/p>\n<p>    visualmap_opts=opts.VisualMapOpts(max_=4000),<\/p>\n<p>)<\/p>\n<h2><strong>\u6e32\u67d3\u5730\u56fe<\/strong><\/h2>\n<p>map.render(&quot;china_population_density_map.html&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3\u4e0e\u5c55\u671b<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u5185\u5bb9\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u4f7f\u7528Python\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u7684\u65b9\u6cd5\u662f\u591a\u79cd\u591a\u6837\u7684\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u9759\u6001\u5730\u56fe\uff0c\u8fd8\u662f\u590d\u6742\u7684\u4ea4\u4e92\u5f0f\u5730\u56fe\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u4e0d\u540c\u7684\u5e93\u6765\u5b9e\u73b0\u3002Pyecharts\u5e93\u7531\u4e8e\u5176\u7b80\u5355\u6613\u7528\u548c\u529f\u80fd\u4e30\u5bcc\uff0c\u6210\u4e3a\u4e86\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u7684\u9996\u9009\u5de5\u5177\u3002\u6b64\u5916\uff0cGeopandas\u548cFolium\u4e5f\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u6ee1\u8db3\u66f4\u9ad8\u7ea7\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><p>\u5728\u672a\u6765\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63a2\u7d22\u66f4\u591a\u7684\u5730\u56fe\u7ed8\u5236\u6280\u5de7\u548c\u5e94\u7528\u573a\u666f\u3002\u4f8b\u5982\uff0c\u7ed3\u5408\u6570\u636e\u5206\u6790\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u6280\u672f\uff0c\u5728\u5730\u56fe\u4e0a\u5c55\u793a\u66f4\u4e3a\u590d\u6742\u7684\u6570\u636e\u5173\u7cfb\uff1b\u6216\u8005\u7ed3\u5408Web\u6280\u672f\uff0c\u5f00\u53d1\u66f4\u52a0\u4ea4\u4e92\u548c\u52a8\u6001\u7684\u5730\u56fe\u5e94\u7528\u3002\u8fd9\u4e9b\u90fd\u662f\u503c\u5f97\u6211\u4eec\u8fdb\u4e00\u6b65\u7814\u7a76\u548c\u5c1d\u8bd5\u7684\u65b9\u5411\u3002<\/p>\n<\/p>\n<p><p>\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u4e0d\u4ec5\u53ef\u4ee5\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\uff0c\u8fd8\u53ef\u4ee5\u7528\u4e8e\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\uff08GIS\uff09\u3001\u57ce\u5e02\u89c4\u5212\u3001\u4ea4\u901a\u7ba1\u7406\u3001\u73af\u5883\u76d1\u6d4b\u7b49\u591a\u4e2a\u9886\u57df\u3002\u5e0c\u671b\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u80fd\u591f\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u5730\u638c\u63e1Python\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u7684\u6280\u5de7\uff0c\u5e76\u5e94\u7528\u5230\u5b9e\u9645\u9879\u76ee\u4e2d\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u7684\u57fa\u672c\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5728Python\u4e2d\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u901a\u5e38\u6d89\u53ca\u4f7f\u7528\u5730\u7406\u4fe1\u606f\u5e93\uff0c\u5982Matplotlib\u548cBasemap\u6216Geopandas\u3002\u57fa\u672c\u6b65\u9aa4\u5305\u62ec\uff1a\u5b89\u88c5\u6240\u9700\u5e93\u3001\u83b7\u53d6\u4e2d\u56fd\u5730\u56fe\u7684\u5730\u7406\u6570\u636e\uff08\u5982Shapefile\u6216GeoJSON\u683c\u5f0f\uff09\u3001\u4f7f\u7528\u7ed8\u56fe\u5e93\u52a0\u8f7d\u5730\u7406\u6570\u636e\u5e76\u8bbe\u7f6e\u5730\u56fe\u7684\u6837\u5f0f\u3001\u6700\u540e\u8c03\u7528\u7ed8\u56fe\u51fd\u6570\u751f\u6210\u5730\u56fe\u5e76\u8fdb\u884c\u663e\u793a\u6216\u4fdd\u5b58\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u65f6\uff0c\u5e94\u8be5\u9009\u62e9\u54ea\u4e9b\u6570\u636e\u6e90\uff1f<\/strong><br \/>\u5e38\u7528\u7684\u6570\u636e\u6e90\u5305\u62ec\u81ea\u7136\u5730\u7406\u6570\u636e\u63d0\u4f9b\u5546\u7f51\u7ad9\uff08\u5982GADM\u3001Natural Earth\uff09\u3001\u5f00\u653e\u8857\u56fe\uff08OpenStreetMap\uff09\u548c\u653f\u5e9c\u90e8\u95e8\u53d1\u5e03\u7684\u5730\u7406\u4fe1\u606f\u3002GeoPandas\u548cBasemap\u7b49\u5e93\u4e5f\u63d0\u4f9b\u4e00\u4e9b\u5185\u7f6e\u7684\u5730\u7406\u6570\u636e\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u7ed8\u5236\u5730\u56fe\u3002<\/p>\n<p><strong>\u5728\u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u65f6\uff0c\u5982\u4f55\u81ea\u5b9a\u4e49\u5730\u56fe\u7684\u6837\u5f0f\u548c\u989c\u8272\uff1f<\/strong><br \/>\u4f7f\u7528Matplotlib\u7684\u7ed8\u56fe\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u4e0d\u540c\u7684\u53c2\u6570\u6765\u81ea\u5b9a\u4e49\u5730\u56fe\u7684\u6837\u5f0f\u548c\u989c\u8272\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>cmap<\/code>\u53c2\u6570\u9009\u62e9\u989c\u8272\u6620\u5c04\uff0c\u5229\u7528<code>edgecolor<\/code>\u53c2\u6570\u8bbe\u7f6e\u8fb9\u754c\u989c\u8272\uff0c\u6216\u8005\u901a\u8fc7<code>alpha<\/code>\u53c2\u6570\u8c03\u6574\u900f\u660e\u5ea6\u3002\u540c\u65f6\uff0cGeoPandas\u652f\u6301\u76f4\u63a5\u5728\u6570\u636e\u6846\u4e2d\u6dfb\u52a0\u6837\u5f0f\u4fe1\u606f\uff0c\u4ece\u800c\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u6837\u5f0f\u81ea\u5b9a\u4e49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python \u7ed8\u5236\u4e2d\u56fd\u5730\u56fe\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Basemap\u5e93\u3001\u4f7f\u7528Geopandas\u5e93\u3001\u4f7f\u7528 [&hellip;]","protected":false},"author":3,"featured_media":1180558,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1180546"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1180546"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1180546\/revisions"}],"predecessor-version":[{"id":1180562,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1180546\/revisions\/1180562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1180558"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1180546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1180546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1180546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}