Applying hold in multiple figure window??

8 ビュー (過去 30 日間)
Nilakantha Meher
Nilakantha Meher 2017 年 4 月 4 日
コメント済み: Nilakantha Meher 2017 年 4 月 4 日
Dear all, I have plotted 4 different curves in 4 different windows using figure(1), figure(2), figure(3), figure(4). I want to apply 'hold' on every figure windows such that I can plot some other curves on each. If I use 'hold', Matlab is holding only figure(1) and not to others.
  1 件のコメント
Nilakantha Meher
Nilakantha Meher 2017 年 4 月 4 日
We need to use 'hold on' for both the figure window. One example below.........
S=[1;2;3;4;5;6;7;9;8;10];
H=[1;5;3;4;6;6;4;2;2;3];
T=[1:10];
figure(1)
hold on
plot(T,S)
figure(2)
hold on
plot(T,H)
Now for next plot on both windows with holding we can plot....
figure(1)
plot(T,H,'r:')
figure(2)
plot(T,S,'k:')

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

採用された回答

KSSV
KSSV 2017 年 4 月 4 日
f1 = figure(1) ;ax1 = axes ;hold(ax1,'on')
f2 = figure(2) ;ax2 = axes ; hold(ax2,'on')
for i = 1:5
plot(ax1,rand(10,1))
plot(ax2,rand(10,1))
end
  1 件のコメント
Nilakantha Meher
Nilakantha Meher 2017 年 4 月 4 日
Thank you for your Answer......... it works. But figure(1) showing two x-axis and y-axis scale due to the command 'axes'. it is taking default axis scales 0:1. But I could find the solution of holding in multiple figure window...... We need to use 'hold on' for both the figure window. One example below.........
S=[1;2;3;4;5;6;7;9;8;10];
H=[1;5;3;4;6;6;4;2;2;3];
T=[1:10];
figure(1)
hold on
plot(T,S)
figure(2)
hold on
plot(T,H)
Now for next plot on both windows with holding we can plot....
figure(1)
plot(T,H,'r:')
figure(2)
plot(T,S,'k:')

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by