Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: how to read .xlsx file in python 
Python :: python working with files and dirs 
Python :: pandas count show one column 
Python :: marshmallow default value 
Python :: python slicing 
Python :: staticmethod python 
Python :: program to add first and last digit of a number in python 
Python :: read csv python 
Python :: docker opencv python libGL.so.1: cannot open shared object file: No such file or directory 
Python :: how to access items in a list 
Python :: current working directory in python 
Python :: Display an image over another image at a particular co-ordinates in openCV 
Python :: python panda count excel sheet 
Python :: matrix diagonal sum leetcode in java 
Python :: python between inheritance and composition 
Python :: flask app with spark 
Python :: tensorflow.keras.utils.to_categorical 
Python :: pandas dataframe row names 
Python :: keras loss plot 
Python :: logistic regression algorithm 
Python :: modify a list with for loop function in python 
Python :: python get text of QLineEdit 
Python :: python os.remove permissionerror winerror 5 access is denied 
Python :: defaultdict python 
Python :: VALUE ERROR EXCEPTION 
Python :: isolationforest estimators 
Python :: All Details in python stack 
Python :: quantile-quantile plot python 
Python :: python write subprocess stdout stderr to file 
Python :: scatter density plot seaborn 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =