Matplotlib scatter plot with different text at each data point

后端 未结 9 2191
挽巷
挽巷 2020-11-22 12:50

I am trying to make a scatter plot and annotate data points with different numbers from a list. So, for example, I want to plot y vs x and annotate

9条回答
  •  时光取名叫无心
    2020-11-22 13:30

    Python 3.6+:

    coordinates = [('a',1,2), ('b',3,4), ('c',5,6)]
    for x in coordinates: plt.annotate(x[0], (x[1], x[2]))
    

提交回复
热议问题