www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/LabelPointOnGraphExample.m

    %% Add Text Description to Data Point
% Plot a sine curve. At the point $(\pi,0)$, add the text description
% $\sin(\pi)$. Use the TeX markup |\pi| for the Greek letter $\pi$. Use
% |\leftarrow| to display a left-pointing arrow.

% Copyright 2015 The MathWorks, Inc.


x = 0:pi/20:2*pi;
y = sin(x);
plot(x,y)
text(pi,0,'\leftarrow sin(\pi)')

%%
% For a list of Greek characters and other TeX markup, see the |Interpreter|
% property description.