Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add horizontal line to plotly scatter

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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #horizontal #line #plotly #scatter
ADD COMMENT
Topic
Name
1+4 =