How Can I plot some coordinates with corresponding names written with it in Python?
Suppose we have some points A(5,3) B(-3,1) C(-6,-4) D(0,-3) E(0,0) F(4,-5)
I want to plot is like this photo
How can I do that?
How Can I plot some coordinates with corresponding names written with it in Python?
Suppose we have some points A(5,3) B(-3,1) C(-6,-4) D(0,-3) E(0,0) F(4,-5)
I want to plot is like this photo
How can I do that?
'''
A(5,3) B(-3,1) C(-6,-4) D(0,-3) E(0,0) F(4,-5)
'''
import matplotlib.pyplot as plt
x = [5,-3,-6,0,0,4]
y = [3,1,-4,-3,0,-5]
n=['A','B','C','D','E','F']
fig, ax = plt.subplots()
ax.scatter(x, y)
for i, txt in enumerate(n):
ax.annotate(txt, (x[i], y[i]))
plt.show()