Plotting subplot with two concurrent plots
9 views (last 30 days)
Show older comments
Nnamdi Ohaka-Akpalaba
on 18 Mar 2019
Edited: Nnamdi Ohaka-Akpalaba
on 18 Mar 2019
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 Comments
Accepted Answer
Matt J
on 18 Mar 2019
Edited: Matt J
on 18 Mar 2019
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 Comment
Nnamdi Ohaka-Akpalaba
on 18 Mar 2019
Edited: Nnamdi Ohaka-Akpalaba
on 18 Mar 2019
More Answers (0)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!