# Add refline in subplots is not work

**URL:** <https://community.plotly.com/t/add-refline-in-subplots-is-not-work/95495>\
**Category:** 📊 Plotly Python\
**Tags:** question, bug-reporter\
**Created:** [November 14, 2025, 6:53am UTC](https://community.plotly.com/t/add-refline-in-subplots-is-not-work/95495 "2025-11-14T06:53:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leavor](https://avatars.discourse-cdn.com/v4/letter/l/7feea3/32.png) [@leavor](https://community.plotly.com/u/leavor)\
**Post date:** [November 14, 2025, 6:53am UTC](https://community.plotly.com/t/add-refline-in-subplots-is-not-work/95495/1 "2025-11-14T06:53:57Z")

</div>

```auto
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:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/2/a/2a6ddcefedb32f8d67de71f08fe771cd4fcc1783.png)

plotly.py version : 6.4.0

---

<div class="post-metadata">

**Author:** ![leavor](https://avatars.discourse-cdn.com/v4/letter/l/7feea3/32.png) [@leavor](https://community.plotly.com/u/leavor)\
**Post date:** [November 14, 2025, 7:10am UTC](https://community.plotly.com/t/add-refline-in-subplots-is-not-work/95495/2 "2025-11-14T07:10:38Z")

</div>

If a reference line is added to a subplot that already has a trace, it can be work
