1. 程式人生 > >繪制針狀圖

繪制針狀圖

image div inf mage plot http baseline 圖片 style

t=[0:0.5:25];
y=exp(-t/3)+sin(1+2*t);
h=stem(t,y,‘--‘);
set(get(h,‘baseline‘),‘linestyle‘,‘:‘);   %把水平軸設置成: 的形狀
set(h,‘markerfacecolor‘,‘yellow‘);
hold on 
t2=[0:0.1:25];
y2=exp(-t2/3)+sin(1+2*t2);
plot(t2,y2,‘r‘,‘linewidth‘,2);
box on;
set(gca,‘Ygrid‘,‘on‘)

  技術分享圖片

繪制針狀圖