fig = make_subplots(rows=2, cols=1) fig.add_hline(y=0, line_dash='solid', line_color='red', line_width=2, row=1, col=1) fig.update_layout(width=600, height=400) fig.show()
the result is:
plotly.py version : 6.4.0
If a reference line is added to a subplot that already has a trace, it can be work