I'm trying to add arrows pointing to data points (start and end of arrow found using "ginput(2)") and add a text label at the end of the arrow. Because the ginput points are in respect to the axes of the plot and the normalized points (used with the "annotation" command) are in respect to the whole figure, I can't figure out how to convert from plot coordinates to normalized so that I can use the annotation function. Is there a property for the plot portion of the figure so that I can find out where the axes limits lie in the figure?
Xrange=max(get(AX(1),'Xlim'))-min(get(AX(1),'Xlim'));
Yrange=max(get(AX(1),'Ylim'))-min(get(AX(1),'Ylim'));
X=(x-min(get(AX(1),'Xlim')))/Xrange +min(get(AX(1),'Xlim'))/Xrange;
Y=(y-min(get(AX(1),'Ylim')))/Yrange +min(get(AX(1),'Ylim'))/Yrange;
annotation('textarrow', X, Y,'String' , LegendText.Fig1{i},'Fontsize',12);
Thanks!