Brexit choropleth

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

gv.extension('matplotlib')
%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]:
%%opts Polygons [color_index='leaveVoteshare' colorbar=True]
gv.Polygons(gdf, vdims=['name', 'leaveVoteshare'], label='Brexit Referendum Vote')
Out[3]:

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