Sankey with custom pathsΒΆ


Python source code: [download source: dc-street-network]

import geoplot as gplt
import as gcrs
import geopandas as gpd
import matplotlib.pyplot as plt

# The data being used here is the DC portion of the Federal Highway Administration's roadway traffic volume
# shapefiles, retrieved from The AADT column of
# interest here is the FHA's traffic volume estimates.

# Load the data.
dc = gpd.read_file("../../data/us_roads/District_Sections.shp")

# Plot the data.
ax = gplt.sankey(dc, path=dc.geometry, projection=gcrs.AlbersEqualArea(), scale='aadt',
                 limits=(0.1, 10))
plt.title("Streets in Washington DC by Average Daily Traffic, 2015")
plt.savefig("largest-cities-usa.png", bbox_inches='tight', pad_inches=0.1)