How to manage XTickLabel values in bodeplot or bodemag?

10 次查看(过去 30 天)
Hi,
I have a problem with displaying specified xtick labels using 'XTick' and 'XTickLabel'. My code looks like this:
figure;
P = bodeoptions;
P.PhaseVisible = 'off';
P.FreqUnits = 'Hz';
bodemag(H,logspace(log10(40*2*pi),log10(400000*2*pi),1001),P);
set(gca,'YLim',[-120 20]);
set(gca,'XLim',[400 40000]);
set(gca,'XTickLabelMode','manual');
set(gca,'XTickLabel',{'400';'';'';'';'';'';'';'';'';'4000';'';'';'';'';'';'';'';'';'40000'});
set(gca,'XTick',[400.0;500.0;600.0;700.0;800.0;900.0;1000.0;2000.0;3000.0;4000.0;5000.0;6000.0;7000.0;8000.0;9000.0;10000.0;20000.0;30000.0;40000.0]);
title '';
grid on;
So, I want to show only characteristic values on x axis, but XTickLabel doesn't work and it show all these values that are set using XTick. Otherwise, this code works for other log plots except bodemag/bodeplot. Please help, best regards

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by