Main Content

このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。

階段状プロットとライン プロットの重ね合わせ

この例では、階段状プロットにライン プロットを重ねる方法を説明します。

プロットするデータを定義します。

alpha = 0.01;
beta = 0.5;
t = 0:10;
f = exp(-alpha*t).*sin(beta*t);

f を階段状プロットとして表示します。関数 hold を使用して、階段状プロットを保持します。星マーカー付きの破線を使用して、f のライン プロットを追加します。

stairs(t,f)
hold on 
plot(t,f,'--*')
hold off

Figure contains an axes object. The axes object contains 2 objects of type stair, line.

関数 axis を使用して軸の範囲を設定します。X 軸にラベルを付け、タイトルをグラフに追加します。

axis([0,10,-1.2,1.2])
xlabel('t = 0:10')
title('Stairstep plot of e^{-(\alpha*t)} sin\beta*t')

Figure contains an axes object. The axes object with title S t a i r s t e p blank p l o t blank o f blank e toThePowerOf - ( alpha * t ) baseline blank s i n beta * t contains 2 objects of type stair, line.

参考

| |