GeezerVison is showing python-graph-gallery.com — Background Map
Background Map
The first step of any geo-spatial data analysis is to draw the background map of the area of interest. This section explains what are the main ways to build it with Python. It is the foundation of the next sections that will add some data on top of it.
A map is basically a set of polygons displayed on a 2 dimensional canvas. There are two problems you need to solve when building one:
Anatomy of a matplotlib chart: all the basic vocabulary you need to know to understand the documentation properly
Where to find polygon coordinates. It can come from:
a shape file or a geoJson file. That's 2 different ways to store the information. The geopandas package is the best way to read those file formats with Python.
a python library like geopandas or basemap providing the information for common location like the US.
google map or open street map.
How to plot those polygons?
Once you get a geodataframe thanks to the geopandas package, geoplot is your best choice to build a static map
If you need an interactive map from a geodataframe, plotly is a good option.
If you want to use google map style maps, folium is the way to go.
GeoPlot & Cartopy
GeoPlot is an extension of Cartopy and Matplotlib to create maps with minimal efforts.
Folium is a wrapper of the leaflet.js javascript library. It allows to make all the data wrangling with python, and benefit the power of javascript for interactive data visualization.
The map below has been created with folium... with 1 line of code only! 😍
Seaborn is another great alternative to build an area chart with python. The below examples show how to start basic, apply usual customization, and use the small multiple technique for when you have several groups to compare.
I have spent years collecting the most beautiful data visualizations out there. Get the list of my top 300 dataviz projects, hand-picked, for free.
I respect your privacy. Unsubscribe anytime.
You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.