Python map libraries

Making maps with the popular Python libraries: Plotly choropleths, scatter, density and animated maps, Folium heatmaps, clusters and tooltips, GeoPandas explore, Cartopy projections, pydeck 3D layers and lonboard for millions of points, with the errors each one throws.

Left, the 1,507 earthquakes of magnitude 5 and larger in 2024 from the USGS catalogue on an equirectangular world, coloured by depth: 1,221 shallow (under 70 km), 226 intermediate and 60 deep (300 km or more); right, the bytes each web map library adds to the HTML per extra point: Folium 187.5, pydeck 76.9, lonboard 29.6 and Plotly 21.8. one dataset, many libraries: they differ in what they draw with and what each point costs1,507 M5+ earthquakes of 2024, by depthFolium187.5 Bpydeck76.9 Blonboard29.6 BPlotly21.8 Bbytes of HTML per extra point, 6,397 to 100,000 points

Python has a map library for every purpose, and choosing the wrong one is the commonest reason a map is hard to read, slow to open or impossible to print. The guides here make real maps with each of them: Plotly choropleths, point, density and animated maps; Folium heatmaps, marker clusters, choropleths with tooltips and PNG export; GeoPandas explore(); Cartopy projections; pydeck 3D columns and hexagons; and lonboard for a million points, with the failures each one is known for.

Every number comes from a run on open data: the USGS earthquake catalogue, Census county estimates, OurAirports and the GNIS names. Folium writes 187.5 bytes of HTML per extra point and Plotly 21.8; 25,081 plain markers become 50,162 images in the browser; a Plotly choropleth matched 0 of 3,144 counties with the wrong featureidkey; and on 2 October 2026 every CARTO raster basemap returned an API KEY REQUIRED tile.

🧭 Start with the concepts

The ideas the how-to guides below assume you already have.

⚙️ Then do the task

Step-by-step walkthroughs with code you can copy and adapt.

Show every how-to guide in this topic

🔧 When it breaks

The errors this topic produces, with the cause explained rather than just the command.

Related topics

Subjects that keep coming up alongside this one, most overlap first.

Keep browsing

Python map libraries sits in Analysis. Every topic on the site is listed on the topics index.