Plotting Module

urbanpy.plotting.choropleth_map(gdf, color_column, df_filter=None, **kwargs)[source]

Produce a Choroplethmap using plotly by passing a GeoDataFrame.

  • gdf (GeoDataFrame) – Input data containing a geometry column and features

  • color_column (str) – Column from gdf to use as color

  • df_filter (pd.Series, default to None) – Pandas Series containing true/false values that satisfy a condition (e.g. (df[‘population’] > 100))

  • **kwargs (Any parameter of plotly.px.choroplethmapbox.)


>>> hex_lima = urbanpy.geom.gen_hexagons(8, lima)
>>> hex_lima['pop_2020'] = population_2020
>>> urbanpy.plotting.choropleth_map(hex_lima, 'pop_2020', [-12, -77])