You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Plotly设置trendline_scope为trace时分组趋势线失效求助

问题

我能绘制基于所有数据极值的趋势线,但希望为每个按Technology字段(颜色分组)的数据集分别生成趋势线。然而将参数trendline_scope从"overall"修改为"trace"后,结果混乱,达不到预期效果。

实现代码
fig = px.scatter(df, "Date", y="Number of X", color="Technology", labels={
                     "Date": "Reported Date",
                     "Number of Qubits": "Number of X",
                     "markersize": 50,
                     "s": 50,
                     "title": "X"

                 }, trendline="expanding", trendline_options=dict(function="max"), trendline_scope="trace")

内容的提问来源于stack exchange,提问作者disruptive

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 14:12:00