I am drawing a chart with a trendline using Plotly Express:
fig = px.scatter(
max_df,
x="signal",
y="profit",
trendline="lowess",
title=f"Best signal per {signal_window_label}",
trendline_color_override="black",
trendline_scope="overall",
color="pair_id",
)
However, the trendline feature is not very useful as the trendline is hard to see below the scatter:
How can I move the trendline to the top of the chart? I already tried this trick I saw on StackOverflow:
fig.data = fig.data[::-1]
But it only affects the order of the legend box (the trendline is the first in the legend), not the actual visual output.
Plotly 5.18.0