I was attempting to add a horizontal line to a Plotly graph using Plotly's add_hline(). It works perfectly fine so long as I do not use the simple_white template. The MWE is here:
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="petal_length", y="petal_width")
fig.add_hline(y=0.9, line_dash='dash', line_color='Red')
fig.update_layout(width=400, height=400,
# template='simple_white'
)
fig.show()
Without the template='simple_white' line, the add_hline() works as expected. With that template though, and with no other changes, the plot is the same but without the horizontal line.


