Applying hold in multiple figure window??

12 visualizaciones (últimos 30 días)
Nilakantha Meher
Nilakantha Meher el 4 de Abr. de 2017
Comentada: Nilakantha Meher el 4 de Abr. de 2017
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 comentario
Nilakantha Meher
Nilakantha Meher el 4 de Abr. de 2017
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:')

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 4 de Abr. de 2017
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 comentario
Nilakantha Meher
Nilakantha Meher el 4 de Abr. de 2017
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:')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by