Hello everyone!
I have two FFT plots and the y-axes are scaled differently: on one, the numbers are multiplied x10^-5, and on the other x10^-6. How can I plot both axes on the same scale, for example x10^-6, for a better comparison? Attached there's an image that shows the different scales on the y-axis, and here is the code that generates the figure:
figure;
subplot(1,2,1)
plot(f_b, P1_b)
title('FFT for baseline')
xlabel('Frequency')
ylabel('|P1(f)|')
subplot(1,2,2)
plot(f_e, P1_e)
title('FFT for experimental condition')
xlabel('Frequency')
ylabel('|P1(f)|')
Also because after that, I'm planning to get the area under the curve, so it would be easier to have the signals on the same scale.
I hope I was clear enough. Thank you very much in advance for your help!

 채택된 답변

KLR
KLR 2020년 7월 11일
편집: KLR 2020년 7월 11일

2 개 추천

Since you are using subplots to plot the data you can use link axis to link the desired axis. Here's the link that explains in more detail. https://www.mathworks.com/help/matlab/ref/linkaxes.html
Or you can manually set the Ylimits for instance in your plot
figure;
subplot(1,2,1)
plot(f_b, P1_b)
title('FFT for baseline')
xlabel('Frequency')
ylabel('|P1(f)|')
subplot(1,2,2)
plot(f_e, P1_e)
% Add a line here to set the y limits
ylim([minimumvalue maximumvalue]) % specify the minimum and maximum value so that both the y axis have the same scale
title('FFT for experimental condition')
xlabel('Frequency')
ylabel('|P1(f)|')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

질문:

2020년 7월 11일

편집:

KLR
2020년 7월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by