作者newton2009 (Life is short & u r hot)
看板MATLAB
标题Re: [讨论] plot 标数字
时间Thu Apr 17 13:18:14 2014
※ 引述《goldberg73 (高柏)》之铭言:
: 如果一资料 如
: a=10 25 35 45
: 想要画出其折线图,有办法顺便在图上显示出数值大小吗??
: 谢谢
a = [10 25 35 45];
x = 1:length(a);
y = a;
figure
plot(x, y, '-')
for i=1:length(a)
text(x(i), y(i), num2str(y(i)))
% 可以调整标记的位置!
end
--
● 日本的骄傲 ● 乒乓球放在上面也不会滚动,
██████████████ 马路就是这麽平!
* 中华民国
的骄傲 ▄ ▄ ▄●▄ ▄ 我们台湾也可以
██████████████ ψ FallRed
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.115.111.179
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/MATLAB/M.1397711913.A.BBE.html
※ 编辑: newton2009 (140.115.111.179), 04/17/2014 14:10:30
1F:推 goldberg73:谢谢! 04/17 14:25
2F:→ newton2009:不会 04/18 13:42