stacked figure from text file

2 visualizaciones (últimos 30 días)
Mohammed Alhamdan
Mohammed Alhamdan el 28 de Dic. de 2022
Editada: Arif Hoq el 28 de Dic. de 2022
I have a text file with 3 column of data
A = load(FileName);
figure;
plot (A(:,1),A(:,2), 'LineWidth',1, 'Color', [0 0.4470 0.7410])
plot (A(:,1),A(:,3), 'LineWidth',1, 'Color', [0.6350 0.0780 0.1840])
This will plot them in one figure
How can I plot them in two stacked figures?

Respuesta aceptada

Arif Hoq
Arif Hoq el 28 de Dic. de 2022
Editada: Arif Hoq el 28 de Dic. de 2022
A=horzcat((1:10)',randi(20,10,1),randi(100,10,1));
figure(4);
plot (A(:,1),A(:,2),'-o', 'LineWidth',1, 'Color', [0 0.4470 0.7410])
plot (A(:,1),A(:,3),'-*', 'LineWidth',1, 'Color', [0.6350 0.0780 0.1840])
with "hold on" command
A=horzcat((1:10)',randi(20,10,1),randi(100,10,1));
figure(6);
plot (A(:,1),A(:,2),'-o', 'LineWidth',1, 'Color', [0 0.4470 0.7410])
hold on
plot (A(:,1),A(:,3),'-*', 'LineWidth',1, 'Color', [0.6350 0.0780 0.1840])
Using Subplot function.
figure(8);
subplot(2,1,1)
plot (A(:,1),A(:,2), 'LineWidth',1, 'Color', [0 0.4470 0.7410])
subplot(2,1,2)
plot (A(:,1),A(:,3), 'LineWidth',1, 'Color', [0.6350 0.0780 0.1840])

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by