Iām following an example from this page Continuous color scales and color bars in Python. The original code is as follows:
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length",
color="sepal_length", color_continuous_scale=px.colors.sequential.Viridis)
fig.show()
But now, If I make a subplot, it loses the color scheme
df = px.data.iris()
fig = make_subplots(rows=2, cols=1, shared_xaxes=True)
fig1 = px.scatter(df, x="sepal_width", y="sepal_length",
color="sepal_length", color_continuous_scale=px.colors.sequential.Viridis)
for trace in fig1.data:
fig.add_trace(trace, row=1, col=1)
fig.show()
Any advice is appreciated!