Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to label points in scatter plot in python

y = [2.56422, 3.77284, 3.52623, 3.51468, 3.02199]
z = [0.15, 0.3, 0.45, 0.6, 0.75]
n = [58, 651, 393, 203, 123]

fig, ax = plt.scatter(z, y)

for i, txt in enumerate(n):
    ax.annotate(txt, (z[i], y[i]))
Comment

PREVIOUS NEXT
Code Example
Python :: Python NumPy split Function Example 
Python :: python extract zip file 
Python :: python print green 
Python :: who created python 
Python :: get ip address py 
Python :: python program to find ascii value of character 
Python :: pandas save dataframe to csv in python 
Python :: python run command 
Python :: how to do a mac vendor lookup in python 
Python :: python read file into variable 
Python :: discord py check if user has permission return message if not 
Python :: python3 shebang 
Python :: python file hashlib 
Python :: python code with sigma 
Python :: Python Requests Library Patch Method 
Python :: dtype in pandas 
Python :: how to add the sum of multiple columns into another column in a dataframe 
Python :: Calculate Euclidean Distance in Python using norm() 
Python :: remove multiindex pandas 
Python :: connectionrefusederror at /accounts/signup/ django allauth 
Python :: python fstring 
Python :: slice notation python 
Python :: with open as file python 
Python :: python random number guessing game 
Python :: pandas nan values in column 
Python :: plt text matplotlib white background 
Python :: python dictionary append 
Python :: match python 
Python :: how to print upto 5 decimal places in python 
Python :: list comprehension if elseif 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =