How to convert series to a continuous color palette ( hex code)

I have a series

[-3. , -2.7, -2.4, -2.3, -2.1, -2. , -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1. , -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2. , 2.1, 2.3, 2.4, 2.7, 3. ]

How can i convert above series to a continuous color of RdYlGn . - 3 being red and 3 being green

Hi @yogi_dhiman ,

is there a reason for limiting to ±3? Here you can find some information and examples:

An adapted example:

import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",
                 color_continuous_scale=["red", "green"])

fig.show()