我想在绘图生成的每个子图中添加0.09 and -0.09
处的水平线。下面是我的代码。在
trace1 = go.Scatter(
x=df1['transaction_date'],
y=df1['difference'],
)
trace2 = go.Scatter(
x=df2['transaction_date'],
y=df2['difference'],
)
trace3 = go.Scatter(
x=df3['transaction_date'],
y=df3['difference'],
)
trace4 = go.Scatter(
x=df4['transaction_date'],
y=df4['difference'],
)
fig = tools.make_subplots(rows=2, cols=2,subplot_titles=('DF1 HS', DF2 HSD',
'DF3 HD', 'DF4 SD',
))
fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 1, 2)
fig.append_trace(trace3, 2, 1)
fig.append_trace(trace4, 2, 2)
然后我想将这4个子块保存为jpeg
在磁盘上。我如何在python中做到这一点
您提到您对
matplotlib
解决方案没意见:数据:
绘图:
^{pr2}$结果:
尝试用
shapes
更新fig
对象的layout
,如下所示:绘图将保存为
Temp_plot.jpeg
。请检查下面的图片。这种方法的缺点是我们需要小心地给}相对于子批次的轴值。在
xref
和{相关问题 更多 >
编程相关推荐