# Change color gradiant of choropleth map

**URL:** <https://community.plotly.com/t/change-color-gradiant-of-choropleth-map/68410>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [September 29, 2022, 1:34am UTC](https://community.plotly.com/t/change-color-gradiant-of-choropleth-map/68410 "2022-09-29T01:34:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaoartur](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@joaoartur](https://community.plotly.com/u/joaoartur)\
**Post date:** [September 29, 2022, 1:34am UTC](https://community.plotly.com/t/change-color-gradiant-of-choropleth-map/68410/1 "2022-09-29T01:34:04Z")

</div>

Hello there, everyone.

I’m trying to change de color gradiant in my choropleth map. Well, surely the awnser is out there but I really coudn’t find it anywhere. There’s a print of my map here

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/1/c/1cc0b552cc7c0d2dcac40bf933146f52bb597ff4.jpeg)

I would like for the color gradiant to start at 100, for example.  
Also, would there be a way to make the scale between the current min and max values ploted?  
Thanks.

---

<div class="post-metadata">

**Author:** ![hoatran](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/hoatran/32/21447_2.png) [@hoatran](https://community.plotly.com/u/hoatran)\
**Post date:** [September 30, 2022, 4:10am UTC](https://community.plotly.com/t/change-color-gradiant-of-choropleth-map/68410/2 "2022-09-30T04:10:57Z")

</div>

As I understand, you can use `range_color` for this case.  
For example:

```auto
fig = px.choropleth_mapbox(df,
                                 locations=df["county_fips"],
                                 geojson=counties,
                                 featureidkey="properties.geoid",
                                 color=df['sale_dollars'],
                                 hover_name="county",
                                 range_color=(0, df['sale_dollars'].iloc[0]),
                                 zoom=5,
                                 center={"lat": 42.01604, "lon": -92.91157},
                                 mapbox_style="carto-positron",
                                 color_continuous_scale="Viridis")

```

So you can change `range_color(100,200) ` or `range_color(df['column'].min(),df['column'].max()`

---

<div class="post-metadata">

**Author:** ![joaoartur](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@joaoartur](https://community.plotly.com/u/joaoartur)\
**Post date:** [October 2, 2022, 2:07am UTC](https://community.plotly.com/t/change-color-gradiant-of-choropleth-map/68410/3 "2022-10-02T02:07:29Z")

</div>

I was able to solve my issue using color\_continuous\_scale=[(0, “yellow”), (0.5, “orange”), (1, “red”)] after going through again and again in the documentation. But thanks anyway!
