Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Choropleth plot with geopandas?


I would like to do a choropleth plot such as these ones :

I download a shape file from government data web sites (for france) and read it using geopandas. This module provides a data frame with a geometry column which contains polygons of several community levels. I wonder if there is a way to use this in plotly ?



Hey Germain –
Great question. There isn’t a way to do this with the Choropleth or geoscatter chart types yet. However, you can add custom shape files to the scattermapbox chart type under layout.mapbox.layers. here is an example:

Here’s a short Jupyter notebook tutorial for creating US county-level choropleth maps in Python with D3.js:

A few examples of the output can be found here (take a few seconds to load):

1 Like

Cleaned things up a bit so that the maps load faster and the rough edges on weather map are trimmed:

1 Like