rotn = np.degrees(np.arctan2((y[:, 1:] - y[:, :-1]) * y_scale, x[:, 1:] - x
    [:, :-1]) * x_scale)
labls = ['first', 'second', 'third', 'fourth', 'fifth']
for i in range(len(x)):
    plt.annotate(labls[i], xy=(x[i, 2], y[i, 2]), rotation=rotn[i, 2])
plt.xlabel('X')
How to annotate text along curved lines in Python?