上面我应该有两个图例,一个用于A型,另一个用于B型 我试过了,但得到了4个传奇
这是我的数据框
这些都是我到目前为止设法搞到的阴谋
代码如下
wellfilter=['Type-A','Type-B']
DFPLOTtemp=DFPLOT
fig = make_subplots(
rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.05, horizontal_spacing=0.1)
for wellfilter, DFPLOTtemp in DFPLOTtemp.groupby('Type'):
fig.add_trace(go.Scatter(x=DFPLOTtemp.DATE, y=DFPLOTtemp.Col_A,mode="lines+markers",
name=wellfilter,connectgaps=False),row=1, col=1)
fig.add_trace(go.Scatter(x=DFPLOTtemp.DATE, y=DFPLOTtemp.Col_C,mode="markers",
name=wellfilter,connectgaps=False),row=2, col=1)
# -----
fig.update_layout(height=800, width=1200,
title_text="Subplot_TEST")
fig.update_xaxes(showline=True, linewidth=2, linecolor='black', mirror=True)
fig.update_yaxes(showline=True, linewidth=2, linecolor='black', mirror=True,rangemode="tozero")
pyo.plot(fig,filename='ploty_test.html')
目前没有回答
相关问题 更多 >
编程相关推荐