Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

label point matplotlib

from matplotlib import pyplot as plt

xC=0 #x cordonate
yC=0 #y cordonate
label = "[your label goes here]" #label text

plt.text(xC, yC, label) 
plt.show()
Comment

matplotlib point labels

import matplotlib.pyplot as plt
import numpy as np

plt.clf()

# using some dummy data for this example
xs = np.arange(0,10,1)
ys = np.random.normal(loc=2.0, scale=0.8, size=10)

plt.plot(xs,ys)

# text is left-aligned
plt.text(2,4,'This text starts at point (2,4)')

# text is right-aligned
plt.text(8,3,'This text ends at point (8,3)',horizontalalignment='right')

plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: csv writer python 
Python :: pandas dataframe unique multiple columns 
Python :: fnd closest element in array numpy 
Python :: matplotlib show grid for log or logit 
Python :: shuffle list 
Python :: max float python 
Python :: simple secatter plot 
Python :: find max length in string in pandas dataframe 
Python :: fill zero behind number python 
Python :: generate a random letter using python 
Python :: Converting uint8 into integers 
Python :: replace multiple values in pandas column 
Python :: python convert object into ditct 
Python :: appending to a file in python 
Python :: how to mention a div with class in xpath 
Python :: how to convert decimal to binary python 
Python :: play sound on python 
Python :: ImportError: /home/user/.local/lib/python3.8/site-packages/pytorch3d/_C.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN2at5zerosEN3c108ArrayRefIlEENS0_13TensorOptionsE 
Python :: python hide details 
Python :: python function returns function 
Python :: discord.py read embed on message 
Python :: root mean squared error 
Python :: loss funfction suited for softmax 
Python :: how to get colored text in python 
Python :: python dict to dataclass 
Python :: django filter by date range 
Python :: what is instance variable in python 
Python :: print elements without print function in python 
Python :: TypeError: expected string or bytes-like object site:stackoverflow.com 
Python :: convert base64 to numpy array 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =