annotation in matlab plot

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-04-08T21:33:39Z Indexed on 2010/04/08 22:43 UTC
Read the original article Hit count: 381

Filed under:
|
|

Hi,

I just wonder how to add annotation in matlab plot? Here is my code:

plot(x,y);  
annotation('textarrow',[x, x+0.05],[y,y+0.05],'String','my point','FontSize',14);

But the arrow points to the wrong place. How can I fix it? And any better idea for annotating a plot?

Thanks and regards!


EDIT:

I just saw from the help document:

annotation('line',x,y) creates a line annotation object that extends from the point defined by x(1),y(1) to the point defined by x(2),y(2), specified in normalized figure units.

In my code, I would like the arrow pointing to the point (x,y) that is drawn by plot(), but annotation interprets the values of x and y as in normalized figure units. So I think that is what causes the problem. How can I specify the correct coordinates to annotation?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about annotation