Reputation: 37
Is there a possibilty in Plotly Express to set the color scale horizontal under the graph. Here is my code:
import plotly.express as px
fig = px.scatter(df, x="year", y="Temperature", trendline="ols",
color="Temperature", color_continuous_scale=px.colors.sequential.Hot_r)
I tried: fig.update_coloraxes(colorbar_orientation="h") but just get an error.
Upvotes: 0
Views: 1364
Reputation: 19
You just need to add:
fig.update_layout(coloraxis=dict(colorbar=dict(orientation='h', y=-0.15)))
Upvotes: 1