python - Annotate plot in matplotlib -
i have 3 vectors a
, b
, , c
in numpy.
the vector b
computed function of a: b = f(a)
.
i'm plotting b
matplotlib plot(a, b)
.
the vector c
has x-positions. want annotate plot @ x-positions in vector c
y-values near values in vector b
.
it easy if compute y-value f(c)
, plotting @ (x,y) = (c,f(x))
since got vector b
computed values, cannot recalculate values values in c
.
i've tried
plt.plt(a,b) x in np.nditer(c): plt.annotate("text", xy=(x, ?), xytext=(x, ?), arrowprops=dict(facecolor='black', arrowstyle="->"))
but don't know y-coordinate.
Comments
Post a Comment