我有 12 个不同的点,其中 10 个与前两个有关;我想分别为这 10 个点中的每一个设置标签,但有时它们中的两个或多个具有相同的坐标,但我想显示该坐标的所有标签(不是彼此重叠,而是可读)
如您所见下图两组点坐标相同且标签重叠
booleanFunction = np.array(["K","I","H" ,"G", "F", "E" , "D" , "M", "B", "A"])
pointsx = np.empty((rs.shape[1],1))
pointsy = np.empty((rs.shape[1],1))
....
....
....
pl.figure()
pl.hold(True)
pl.plot(X1, Y1, 'ro', X2, Y2, 'y<')
pl.plot(pointsx, pointsy, 'b3')
for i in range (len(pointsx)):
pl.annotate(booleanFunction[i], xy=(pointsx[i], pointsy[i]), xycoords='data', textcoords='data')