Brexit choropleth

In [1]:
import pandas as pd
import geopandas as gpd
import geoviews as gv

gv.extension('matplotlib')
gv.output(fig='svg', size=200)

Declaring data

In [2]:
geometries = gpd.read_file('../../assets/boundaries/boundaries.shp')
referendum = pd.read_csv('../../assets/referendum.csv')
gdf = gpd.GeoDataFrame(pd.merge(geometries, referendum))

Plot

In [3]:
gv.Polygons(gdf, vdims=['name', 'leaveVoteshare'], label='Brexit Referendum Vote').opts(
    color='leaveVoteshare', colorbar=True, padding=0.1)
Out[3]:

Download this notebook from GitHub (right-click to download).