【发布时间】:2022-01-10 03:09:19
【问题描述】:
我需要关于 plotly 的帮助 - 在每个子图中绘制带有多条线的时间序列交互式图表。我的数据如下所示:
import pandas as pd
df1 = pd.DataFrame(np.random.randint(100, size=(100,6)), columns=['A_red', 'A_blue', 'B_red', 'B_blue', 'C_red', 'C_blue'])
接下来我想做的:
import plotly.express as px
fig1 = px.line(df, y=['A_red', 'A_blue'], color=['red', 'blue'])
fig2 = px.line(df, y=['B_red', 'B_blue'], color=['red', 'blue'])
fig3 = px.line(df, y=['C_red', 'C_blue'], color=['red', 'blue'])
figs = [fig1, fig2, fig3]
figs.show()
我无法在 spyder 中加载任何绘图(内联或绘图选项卡),我如何将颜色映射到不同的行?
谢谢
【问题讨论】:
标签: python pandas plotly plotly-python