looking for marker text option for pyplot.plot()
问题 I am looking for a way to insert numbers or text into markers. There is nothing in the matplotlib.pyplot.plot(*args, **kwargs) documentation about that. The default zoom level places markers on the edge, hence reducing the available space on which to inscribe text. import matplotlib.pyplot as plt x = [1, 2, 3, 4 ,5] y = [1, 4, 9, 6, 10] plt.plot(x, y, 'ro',markersize=23) plt.show() 回答1: As jkalden suggested, annotate would solve your problem. The function's xy -argument let you position the