【matplotlib】散布図の各点に文字を付けたい
以下のように図を作成する
以下、上記の図を生成させるコード
%matplotlib inline from pylab import * import matplotlib.pyplot as plt fig,ax = plt.subplots() x_list = [0,1,2] y_list = [0,0,0] ax.scatter(x_list,y_list) # 下の二行で各点に番号をつける for i,(x,y) in enumerate(zip(x_list,y_list)): ax.annotate(str(i),(x,y))