I have a situation where I need to plot a list of points where they can overlap. The problem is that the Point label are overlapping, and I need to identify which point is where.
having sample code:
import matplotlib.pyplot as plt
Nu = [6.0155, 12.031, 12.031, 12.031, 12.031]
Ra = [40.22, 40.66, 40.66, 40.66, 40.66]
P = ["P_1", "P_2", "P_3", "P_4", "P_5"]
fig, ax = plt.subplots()
plt.scatter(Ra, Nu)
for i, txt in enumerate(P):
plt.annotate(txt, (Ra[i], Nu[i]))
Got this result:
Where 5 points and annotations are overlapping in top right corner.

