stacked figure from text file

조회 수: 1 (최근 30일)
Mohammed Alhamdan
Mohammed Alhamdan 2022년 12월 28일
편집: Arif Hoq 2022년 12월 28일
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