Is it possible to set the line of a line chart as a continuous scale like Viridis? I did several attempts but my best result was a discrete scale based on a third variable. How can I initialize for example lifeExp as the values for a continuous scale? .astype(int) did not help.
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()