我如何利用 plotly.express 在一个 Pandas 数据框中的两个 yaxis 上绘制多条线?
我发现这对于绘制包含特定子字符串的所有列非常有用:
fig = px.line(df, y=df.filter(regex="Linear").columns, render_mode="webgl")
Run Code Online (Sandbox Code Playgroud)
因为我不想遍历所有过滤的列并使用以下内容:
fig.add_trace(go.Scattergl(x=df["Time"], y=df["Linear-"]))
Run Code Online (Sandbox Code Playgroud)
在每次迭代中。