← 返回首页
Bubble Map | Python Graph Gallery

Bubble Map

A bubble map uses circles of different size to represent a numeric value on a territory. It displays one bubble per geographic coordinate, or one bubble per region. As for background maps, several python libraries are useful to build them: folium, geopandas, geoplot and basemap are listed here.

GeoPlot & Cartopy

GeoPlot is an extension of Cartopy and Matplotlib to create maps with minimal efforts.

When creating maps, there are a large number of possible projections. The article below explains how to modify them.

Change projection in maps

Bubble map with Folium

Folium is a wrapper of the leaflet.js javascript library. Once you understood how to initialize an interactive map with it, you can parse a data frame of coordinates and add markers to the map with functions like Circle() and ..()

See code

It is also possible to add any other kind of markers instead of circles. This is what you get with the default folium.Marker() function:

See code

And this is what you can build by passing some html to the marker and popup parameters:

Bubble map with Basemap

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.

Bubble map with Python and the basemap library

Best bubble map examples

The below examples show how to create advanced bubble maps with python using real life data.

🚨 Grab the Data To Viz poster!


Do you know all the chart types? Do you know which one you should pick? I made a decision tree that answers those questions. You can download it for free!

    Get Poster