# Ploty continuous color scale in line chart

**URL:** <https://community.plotly.com/t/ploty-continuous-color-scale-in-line-chart/47089>\
**Category:** 📊 Plotly Python\
**Created:** [November 11, 2020, 9:53pm UTC](https://community.plotly.com/t/ploty-continuous-color-scale-in-line-chart/47089 "2020-11-11T21:53:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shidra](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/shidra/32/13285_2.png) [@Shidra](https://community.plotly.com/u/Shidra)\
**Post date:** [November 11, 2020, 9:53pm UTC](https://community.plotly.com/t/ploty-continuous-color-scale-in-line-chart/47089/1 "2020-11-11T21:53:01Z")

</div>

Hi, I was experimenting with the various options available, but I couldn’t manage to set continuous color scale on a single line of a line chart. Discrete colors worked fine. I would appreciate if someone could point me the right direction regarding how to use x or y (in this case year or life expectancy) or any other values to set continuous color if it is possible. I pasted a basic line chart sample from the documentation:

```auto
import plotly.express as px

df = px.data.gapminder().query("country=='Canada'")
fig = px.line(df, x="year", y="lifeExp", title='Life expectancy in Canada')
fig.show()

```

In addition I also posted the same question on [stackoverflow](https://stackoverflow.com/questions/64759565/ploty-continuous-color-scale-in-line-chart) earlier if someone wants to grab the points for answering it.

---

<div class="post-metadata">

**Author:** ![Alexboiboi](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/alexboiboi/32/6420_2.png) [@Alexboiboi](https://community.plotly.com/u/Alexboiboi)\
**Post date:** [November 12, 2020, 10:26pm UTC](https://community.plotly.com/t/ploty-continuous-color-scale-in-line-chart/47089/2 "2020-11-12T22:26:13Z")

</div>

Hi @Shidra,

this is not currently possible, this features is still waiting for some sponsorship 😉  
see here:

> <https://github.com/plotly/plotly.js/issues/581>
>
> Hello,
> I can't make work the marker.line.colorscale property. I'm not sure how it should work, but what I can say is:
> using the...

Alex-
