stacked figure from text file

2 ビュー (過去 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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by