Skip to content

Instantly share code, notes, and snippets.

@ageller
Last active November 13, 2023 19:05
Show Gist options
  • Save ageller/55445d1fecb49212d1ab4334f1f43631 to your computer and use it in GitHub Desktop.
Save ageller/55445d1fecb49212d1ab4334f1f43631 to your computer and use it in GitHub Desktop.
create a choropleth
cmap = matplotlib.colormaps['Reds']
norm = matplotlib.colors.Normalize(vmin = min(gdf['Total Potholes']), vmax = max(gdf['Total Potholes']))
co = cmap(norm(gdf['Total Potholes']))
ap = norm((gdf['Total Potholes'])).clip(0,1)
gdf.plot(ax = ax, color = co, alpha = ap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment