matplotlib scatter plot annotate / set text at / label each point

matplotlib scatter plot annotate / set text at / label each point

a hard question in matplotlib is to annotate each point with a text or label. answers range from ax.annotate to some more weird stuffs. fortunately, the answer is a simple one! this question poses itself quite often in scatter plots

the key

without beating around the bush, the answer is using pyplot.text found here

demo

code :

output :

matplotlib label annotate points
matplotlib label points

Lives in Mauritius, cruising python waters for now.

Comments are closed.