stacked figure from text file

2 次查看(过去 30 天)
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?

采纳的回答

Arif Hoq
Arif Hoq 2022-12-28
编辑:Arif Hoq 2022-12-28
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])

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by