Plotting subplot with two concurrent plots
1 回表示 (過去 30 日間)
古いコメントを表示
Nnamdi Ohaka-Akpalaba
2019 年 3 月 18 日
編集済み: Nnamdi Ohaka-Akpalaba
2019 年 3 月 18 日
I have two different graphs, which I would like to plot in a 2x5 subplot array.
I want the first 5 plots to be for graph1, and the bottom 5 plots to be for graph2, but this needs to all be in the same figure.
figure;
for k = 1:5
subplot(1,5,k);
[val,loca]=(max(abs(squeeze(S(1,k,:,:)))));
plot(T,squeeze(abs(S(1,k,92,:))),T,squeeze(abs(S(1,k,52,:)))); % graph1
legend('f1','f2')
title('Amplitude of f verses time')
ylabel('amplitude A.U')
xlabel('time (ns)')
end
figure;
for k = 1:5
subplot(1,5,k);
plot(T,F(loca),'m'); % graph2
title('Amplitude of f verses time')
ylabel('Frequency (Hz)')
xlabel('time (ns)')
legend('found F')
end
I need help with how to code so its all in one figure
0 件のコメント
採用された回答
Matt J
2019 年 3 月 18 日
編集済み: Matt J
2019 年 3 月 18 日
figure;
for k = 1:5
subplot(2,5,k);
[val,loca]=(max(abs(squeeze(S(1,k,:,:)))));
plot(T,squeeze(abs(S(1,k,92,:))),T,squeeze(abs(S(1,k,52,:)))); % graph1
legend('f1','f2')
title('Amplitude of f verses time')
ylabel('amplitude A.U')
xlabel('time (ns)')
end
for k = 1:5
subplot(2,5,k);
plot(T,F(loca),'m'); % graph2
title('Amplitude of f verses time')
ylabel('Frequency (Hz)')
xlabel('time (ns)')
legend('found F')
end
1 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!