# Use GeoPandas to force a choropleth to use a legend with a greater range than the data provided in the column

I have a list of cities, and I'm trying to graph individual choropleth maps for each city's census tracts (coloring is based on their `density` column).

However, I'd like the choropleth to color the census tracts (polygons) based on the entire range of density for all cities, not just the city being graphed.

For example: If Dallas, TX has a minimum density of `0` and a maximum is `5000`, and `5000` is the largest density out of my list of cities, I'd like the choropleth to use that number when coloring in census tracts for each individual city. So if I plot Irving, TX, which would have a maximum density of `200`, that is much less that `5000`, and the coloring should reflect that.

But right now, if I run:

``````irving.plot(columns='density', ax=ax, cmap='cool', legend=True)
``````

The choropleth will color Irving's census tracts with 0 as the minimum and 200 as the maximum. How can I force the maximum to be what I want and have the choropleth's coloring reflect this?

• not 100% sure, but did you try setting vmin and vmax? that's how its done in matplotlib. Aug 27, 2022 at 15:58
• You are right! I'm answering the question below. Aug 29, 2022 at 15:33

``````vmax : None or float (default None)
All I needed to do was find the global maximum value (`global_max`) of `density` for my cities, and set that value with `vmax=global_max` when using geopandas.plot(). The code below is an example:
``````irving.plot(columns='density', ax=ax, cmap='cool', legend=True, vmax=global_max)