Last active
November 13, 2023 19:05
-
-
Save ageller/55445d1fecb49212d1ab4334f1f43631 to your computer and use it in GitHub Desktop.
create a choropleth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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