Change x-axis.
古いコメントを表示
I wanna start x-axis from 1500.Is there function for that. using axis([1500 1600 0 inf]) doesnt work

回答 (1 件)
Azzi Abdelmalek
2016 年 4 月 3 日
0 投票
Use xlim and ylim
8 件のコメント
sashish acharya
2016 年 4 月 3 日
Azzi Abdelmalek
2016 年 4 月 3 日
xlim([1500 inf])
sashish acharya
2016 年 4 月 3 日
Azzi Abdelmalek
2016 年 4 月 3 日
You asked how to set x-axis from 1500, that's what the picture shows, what is you problem?
sashish acharya
2016 年 4 月 3 日
Azzi Abdelmalek
2016 年 4 月 3 日
xt=get(gca,'xtick')
xt1=linspace(1500,1600,numel(xt))
xtck1=arrayfun(@num2tr,xt1)
set(gca,'xticklabel',xtck1)
You have no data at x=1500, so why would you want to start it there? If you mean that you want to relabel the x-axis, you can use
xticklabels = get(gca,'xtick');
xticklabels = xticklabels + 1500;
set(gca,'xticklabel',xticklabels)
Oh, it looks like you want to convert frequency to wavelength. That has been asked many times, e.g. http://www.mathworks.com/matlabcentral/answers/80537-how-do-i-convert-the-x-axis-of-an-fft-from-frequency-to-wavelength
sashish acharya
2016 年 4 月 3 日
カテゴリ
ヘルプ センター および File Exchange で Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
