Image source: https://link.medium.com/KHHzCLBtmjb

Create maps with Geopandas and customize them with Matplotlib in Python

Create density maps with Python in minutes

Damian
6 min readSep 7, 2021

--

Thematic maps allow the people to easily identify how a category or any measurement is distributed in a territory. In particular, density maps, more appropriately called choropleth, refer to those thematic maps that show the spatial distribution of a quantity, commonly statistical. Given the importance of maps in data visualization, it is essential that as python programmers have the tools and skills to display them.

Part 1: Libraries to use

Matplotlib is the most famous library for making charts. Basically everyone who starts in python must learn to use it. It is a robust library, although it lacks a bit of design, but it makes up for it by relying on another famous graphics library: Seaborn.

Geopandas. The name itself tells us what the library is about. It has Pandas functionalities, the most versatile library for organizing data, but with the ability to read vector data: points, lines and polygons, which are essential to represent information in space. The most famous vector file format is shape (.shp), which will be used in this tutorial.

Unlike Matplotlib, it is not installed by default. But it can easily be installed in the…

--

--

Damian

Anything I want and is related to data. Learning to become a Data Professional.