If I feed several x/y sets to matplotlib.pyplot.plot, how does annotate
decide how to correlate the xy value to one of the sets? Is there an assumption that all the sets are scaled the same way?
plt.plot(clist, plist, 'g', clist, rlist, 'r', clist, flist, 'b')
plt.annotate("%d chars F=%f" % (threshold_c, threshold_f), xy=(threshold_c, threshold_f),
xytext=(-50, 30), textcoords='offset points',
arrowprops=dict(arrowstyle="->"))
We seem to have a good answer, but someone asked for clarification.
Calling annotate with the default xy=
has the effect of associating an annotation with a graphed x/y pair. When there's one X array and one Y array, it's obvious to me what that means.
With multiples, I didn't know if plot
was going to automatically set up multiple sets of axes, one for each X/Y array -- and, if so, how annotate was going to work. The answer explains that one call to plot creates one set of axes that scales all the X/Y sets as best it can, and so annotate knows where to go.