import plotly.express as px df = pd.DataFrame({"x":[0, 1, 2, 3, 4,6,8,10,12,15,18], "y":[0, 1, 4, 9, 16,13,14,18,19,5,12]}) fig = px.scatter(df, x="x", y="y") fig.add_hline(y=5) fig.add_hline(y=18) fig.show()