{"id":9335,"date":"2020-02-18T16:17:26","date_gmt":"2020-02-18T08:17:26","guid":{"rendered":"https:\/\/www.finereport.com\/en\/?p=9335"},"modified":"2025-04-15T15:24:50","modified_gmt":"2025-04-15T07:24:50","slug":"3-types-of-map-data-visualization-in-python","status":"publish","type":"post","link":"https:\/\/www.finereport.com\/en\/data-visualization\/3-types-of-map-data-visualization-in-python.html","title":{"rendered":"3 Types of Map Data Visualization in Python"},"content":{"rendered":"<div id=\"toc_container\" class=\"toc_transparent no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#What_is_map_data_visualization\">What is map data visualization?<\/a><\/li><li><a href=\"#Tools_to_achieve_map_data_visualization\">Tools to achieve map data visualization<\/a><ul><li><a href=\"#First_is_bokeh\">First is bokeh<\/a><\/li><li><a href=\"#Next_is_basemap\">Next is basemap<\/a><\/li><li><a href=\"#Finally_is_geopandas\">Finally is geopandas<\/a><\/li><\/ul><\/li><li><a href=\"#Map_Data_Visualization_Platforms\">Map Data Visualization Platforms<\/a><\/li><li><a href=\"#Excel_for_map_data_visualization\">Excel for map data visualization<\/a><\/li><li><a href=\"#Youmight_also_be_interested_in\">You\u00a0might also be interested in\u2026<\/a><\/li><\/ul><\/div>\n<h2><span id=\"What_is_map_data_visualization\">What is map data visualization?<\/span><\/h2>\n<p>Before we start to make map data visualization, we need to know what is it?<\/p>\n<p>To be simple, map data visualization is to transform geographic data into a visual form. By visualizing the data with regional characteristics or the results of data analysis on the map, users can more easily understand the laws and trends of data.<\/p>\n<p>In layman&#8217;s terms, map visualization can present geographic data more clearly and directly. It can&#8217;t be denied that Maps are the most commonly used form of data visualization today. Good map visualization integrates information into geographic context, contains a lot of information, and is extremely aesthetically pleasing and shocking.<\/p>\n<h2><span id=\"Tools_to_achieve_map_data_visualization\">Tools to achieve map data visualization<\/span><\/h2>\n<p>At present, there are many tools that can implement map data visualization, which can be divided into three types: programming, platform, and software:<\/p>\n<p><strong>Programming: Matlab, Python, Echarts<\/strong><br \/><strong>Platform: FineReport, Tableau, Power BI<\/strong><br \/><strong>Software: Excel<\/strong><\/p>\n<p>For most people, Excel has always been the first choice, but is Excel really the best tool for map visualization?<\/p>\n<p>In this article, I will introduce the advantages and disadvantages of the above three types of tools, and focus on the map data visualization in python. I hope you can find a tool that meets your needs.<\/p>\n<p>Python is one of the easier to get started in programming languages, and can very efficiently implement map data visualization of large amounts of data.<\/p>\n<p>The Python map visualization library has well-known<strong><em> pyecharts<\/em>, <em>plotly<\/em>, <em>folium<\/em><\/strong>, as well as slightly low-key <strong><em>bokeh<\/em>, <em>basemap<\/em>, <em>geopandas<\/em><\/strong>, they are also a weapon that cannot be ignored for map visualization.<\/p>\n<p>Next, I will introduce these three low-key python map visualization tools.<\/p>\n<h3><span id=\"First_is_bokeh\">First is <em>bokeh<\/em><\/span><\/h3>\n<p><em>Bokeh<\/em> is good at making interactive graphics, and of course, it is not inferior to map data visualization.<\/p>\n<p>For example, like this<\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/01-1.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-9336\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/01-1.gif\" alt=\"\" width=\"639\" height=\"482\" \/><\/a><\/p>\n<p>And this<\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/02-1.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-9337\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/02-1.gif\" alt=\"\" width=\"639\" height=\"482\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<p>Code link: https:\/\/automating-gis-processes.github.io\/2017\/lessons\/L5\/interactive-map-bokeh.html<\/p>\n<p><em>Bokeh<\/em> supports the geographic visual display of Google maps and JSON data. The most important\u00a0is\u00a0it can realize\u00a0dynamic interaction.<\/p>\n<p><em>Bokeh<\/em>&#8216;s official website provides detailed map visualization solutions. If you are interested in it, you can pull out the sample code and run.<\/p>\n<p>Learning website: <a href=\"https:\/\/docs.bokeh.org\/en\/lates\"><u>https:\/\/docs.bokeh.org\/en\/lates<\/u><\/a><\/p>\n<p>\u00a0<\/p>\n<h3><span id=\"Next_is_basemap\">Next is <em>basemap<\/em><\/span><\/h3>\n<p>It is no exaggeration to say that <em>basemap<\/em> is the best third-party library for python map visualization.<\/p>\n<p><em>Basemap<\/em> is developed based on<em> matplotlib<\/em>, so it has all the functions to create a data visualization, and must be used with <em>matplotlib<\/em>.<\/p>\n<p>It only takes a few lines of code to draw a world map:<\/p>\n<blockquote>\n<p>from mpl_toolkits.basemap import Basemap<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<p>map = Basemap()<\/p>\n<p>map.drawcoastlines()<\/p>\n<p>plt.show()<\/p>\n<p>plt.savefig(&#8216;test.png&#8217;)<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/03.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-9340\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/03.png\" alt=\"\" width=\"652\" height=\"334\" srcset=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/03.png 1764w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/03-300x154.png 300w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/03-768x394.png 768w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/03-1024x525.png 1024w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<blockquote>\n<p>from mpl_toolkits.basemap import Basemap<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<p>map = Basemap(projection=&#8217;ortho&#8217;,lat_0=0, lon_0=0)<\/p>\n<p>#Fill the globe with a blue color<\/p>\n<p>map.drawmapboundary(fill_color=&#8217;aqua&#8217;)<\/p>\n<p>#Fill the continents with the land color<\/p>\n<p>map.fillcontinents(color=&#8217;coral&#8217;,lake_color=&#8217;aqua&#8217;)<\/p>\n<p>map.drawcoastlines()<\/p>\n<p>plt.show()<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/04.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-9341\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/04.png\" alt=\"\" width=\"388\" height=\"373\" srcset=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/04.png 1174w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/04-300x288.png 300w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/04-768x738.png 768w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/04-1024x984.png 1024w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/a><\/p>\n<p>Note: Because <em>basemap<\/em> supports py2, and py2 has been discontinued, <em>basemap<\/em> is also abandoned by <em>matplotlib<\/em>. It is replaced by <em>cartopy<\/em>, which supports py3 and perfectly integrates <em>matplotlib<\/em>.<\/p>\n<h3><span id=\"Finally_is_geopandas\">Finally is <em>geopandas<\/em><\/span><\/h3>\n<p><em>Geopandas<\/em>, as the name suggests, is a map data visualization tool based on <em>pandas<\/em>, so it is very convenient for processing geographic data.<\/p>\n<p>\u00a0<\/p>\n<p>It is recommended that you use g<em>eopandas<\/em> as the main tool for geographic information data processing.\u00a0Next, I will write a clear guide on how to use <em>geopandas<\/em> for you!<\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/13.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-9342\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/13.png\" alt=\"\" width=\"620\" height=\"381\" srcset=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/13.png 1384w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/13-300x184.png 300w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/13-768x472.png 768w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/13-1024x629.png 1024w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<h2><span id=\"Map_Data_Visualization_Platforms\">Map Data Visualization Platforms<\/span><\/h2>\n<p>In fact, in addition to using python, we can directly use some data visualization tools to accomplish this. There are many such softwares on the market today, such as Tableau and PowerBI, which are more suitable for professional data analysts, these softwares have complete functions and very friendly interaction.<\/p>\n<p>But for some data visualizations that just want to show research results, FineReport and some online websites(<strong><a href=\"https:\/\/www.arcgis.com\/home\/\" target=\"_blank\" rel=\"noopener noreferrer\">ArcGIS Online Platform<\/a><\/strong>) which can generate map charts may be a better choice. Most of them are free and can also provide excellent map display.<\/p>\n<p>Here are some map data visualization images made by FineReport.<\/p>\n<p>\u00a0<\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/product-functions\/pure-report-operated-heat-map-tutorial-without-one-line-of-code.html\"><strong>Heatmap of earthquake frequency in Southeast Asia\u00a0<\/strong><\/a><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071809L.png\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-9344\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071809L.png\" alt=\"\" width=\"1345\" height=\"531\" srcset=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071809L.png 1345w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071809L-300x118.png 300w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071809L-768x303.png 768w, https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071809L-1024x404.png 1024w\" sizes=\"(max-width: 1345px) 100vw, 1345px\" \/><\/a><\/p>\n<p><strong>3D Earth<\/strong><\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071801L.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-9345\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2020\/02\/2019071801L.gif\" alt=\"\" width=\"480\" height=\"349\" \/><\/a><\/p>\n<h2><span id=\"Excel_for_map_data_visualization\">Excel for map data visualization<\/span><\/h2>\n<p>Excel is a familiar office software, but it is also a reliable map visualization software. For those who do not want to spend time choosing other tools, Excel is undoubtedly a very good choice. In the 2016 version of the Excel tab, you can directly choose to insert a 3D map. You only need to obtain geographic data, and then follow the normal chart settings to complete a beautiful map data visualization.<\/p>\n<p>About an Excel guide, you can follow\u00a0<a href=\"https:\/\/www.finereport.com\/en\/data-visualization\/i-made-a-dynamic-hurricane-map-with-excel%ef%bc%81.html\">I Made a Dynamic Hurricane Map with Excel!\u00a0<\/a><\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2019\/10\/excel-\u98d3\u98ce\u56fe.gif\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-8318\" src=\"https:\/\/www.finereport.com\/en\/wp-content\/uploads\/2019\/10\/excel-\u98d3\u98ce\u56fe.gif\" alt=\"\" width=\"1486\" height=\"846\" \/><\/a><\/p>\n<p>This guide will teach you how to make a hurricane map step by step!! Is it amazing\uff1f<\/p>\n<h2><span id=\"Youmight_also_be_interested_in\"><strong>You\u00a0might also be interested in\u2026<\/strong><\/span><\/h2>\n<p><a href=\"https:\/\/www.finereport.com\/en\/data-visualization\/top-16-types-of-chart-in-data-visualization.html\">\u00a0Top 16 Types of Chart in Data Visualization<\/a><\/p>\n<p><a href=\"https:\/\/www.finereport.com\/en\/about-finereport\/how-can-beginners-design-cool-data-visualizations.html\">\u00a0How Can Beginners Design Cool Data Visualizations?<\/a><\/p>\n<p class=\"entry-title\"><a href=\"https:\/\/www.finereport.com\/en\/data-visualization\/3-types-and-5-management-dashboard-examples-sorted-by-departments.html\">3 Types and 5 Management Dashboard Examples Sorted by Departments<\/a><\/p>\n<p>Partly sourced from https:\/\/zhuanlan.zhihu.com\/pydatalysis<\/p>\n<p>Author: zhuweijun<\/p>\n<p>\u00a0<\/p>\n<blockquote>\n<p>Tips: feel free to make an appointment for a live demo with our product experts. We will be more clear about your needs and see how FineReport can help you and your organization to transform data into value.<\/p>\n<\/blockquote>\n<p><a style=\"color: #fff; background-color: #2849f7; border: none; border-radius: 20px; width: 180px; height: 40px; font-size: 16px; line-height: 26px; display: inline-block; padding: 6px 12px; margin-bottom: 0; text-align: center;\" href=\"\/en\/bookademo\">Book a Free Demo<\/a><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will introduce 3 useful python libraries: bokeh, basemap, geopandas to make a cool map data visualization!<\/p>\n","protected":false},"author":1,"featured_media":9336,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[854],"tags":[118],"yst_prominent_words":[3156,177,443,3163,3165,3167,3166,3158,1120,1107,3159,1220,3152,1317,1115,3157,3154,3155,3153,676],"_links":{"self":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts\/9335"}],"collection":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/comments?post=9335"}],"version-history":[{"count":9,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts\/9335\/revisions"}],"predecessor-version":[{"id":19486,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/posts\/9335\/revisions\/19486"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/media\/9336"}],"wp:attachment":[{"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/media?parent=9335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/categories?post=9335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/tags?post=9335"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.finereport.com\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=9335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}