How to change the scale of the x-axis & y-axis?
550 ビュー (過去 30 日間)
古いコメントを表示
I have written a code which used to plot the spectrogram of a signal. This line was to get the spectrogram:
[s,f2,t] = spectrogram(xc,win,noverlap,FFT_LENGTH,fs,'yaxis');
Then I used imagesc to plot the spectrogram: imagesc(t,f2,20*log10(abs(s)));
Everything is working fine except I want to decrease the scale of the x-axis & y-axis. How can I do that?
1 件のコメント
回答 (3 件)
Aron Magesh
2020 年 7 月 5 日
For changing the axis scale use the following function:
for example low=10,high=100 and interval=5
set(gca,'xtick', 10:5:100)
0 件のコメント
Kevin Chng
2018 年 10 月 22 日
you may use xlimit() or ylimit() to rescale your plot.
4 件のコメント
Kevin Chng
2018 年 10 月 24 日
Try
h.figure
w = h.Position;
%plot your graph
h.Position = [w(1) w(2) w(3)*1.5 w(4)]
Will it work for you?
Adam
2018 年 10 月 23 日
編集済み: Adam
2018 年 10 月 23 日
doc interp2
is likely what you need if you want finer resolution to get rid of step-like features, but how was anyone to interpret that from you just keep repeating 'change the scale'? You need to be a lot more precise to get a faster answer.
Or since you are creating a spectrogram you could just use a finer discretisation of the frequencies and/or the times used to compute it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Time-Frequency Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!