How to get text appearing within only one plot

7 ビュー (過去 30 日間)
Natasha Simone
Natasha Simone 2018 年 2 月 21 日
コメント済み: Natasha Simone 2018 年 2 月 21 日
I am meant to reproduce this image:
This is what I currently have:
This is my code:
t = linspace(0,2*pi,1000);
for n=1:5 %First row 1:1
w = [1 1 1 -1 -1];
d = [0 pi/4 pi/2 pi/4 0];
x = sin(w(n) * t+d(n));
y = sin(t);
subplot(8,5,n), plot(x,y)
txt1 = '1:1'; text(0.5,0.5,txt1)
axis([-1 1 -1 1]), axis square off
end
How can I get the text 1:1 to only appear in the left most image

回答 (1 件)

KSSV
KSSV 2018 年 2 月 21 日
編集済み: KSSV 2018 年 2 月 21 日
t = linspace(0,2*pi,1000);
for n=1:5 %First row 1:1
w = [1 1 1 -1 -1];
d = [0 pi/4 pi/2 pi/4 0];
x = sin(w(n) * t+d(n));
y = sin(t);
subplot(8,5,n), plot(x,y)
axis([-1 1 -1 1]), axis square off
end
txt1 = '1:1'; text(0.5,0.5,txt1)
Put your desired text out side the loop.
  1 件のコメント
Natasha Simone
Natasha Simone 2018 年 2 月 21 日
that puts it on the right side
Is there anyway to get it on the left? like:

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by