How to display only selected xticks?
33 ビュー (過去 30 日間)
古いコメントを表示
Csanad Levente Balogh
2021 年 3 月 9 日
コメント済み: Csanad Levente Balogh
2021 年 3 月 10 日
HI!
figure
stairs(fl,db(sqrt(sTO)))
irs(cfm(6:end),db(sqrt(p(6:end))))
xticks(ff)
xticklabels(cfs);
xtickangle(45)
set(gca,"XScale","log")
Even though I set xticks, the default ticks appear too.
I also tried puting
set(gca,'xtick',[])
before seting the x ticks. It didn't work. How can I display the wanted xticks without the default tickes?
0 件のコメント
採用された回答
Cris LaPierre
2021 年 3 月 9 日
The xticks function should be all you need.
X = linspace(0,4*pi,40);
Y = sin(X);
figure
stairs(Y)
xticks([7 12 18 33])
3 件のコメント
Cris LaPierre
2021 年 3 月 10 日
Those are minor ticks. They have a different setting. Try this.
X = linspace(0,4*pi,40);
Y = sin(X);
figure
stairs(Y)
xticks([7 12 18 33])
set(gca,"XScale","log")
set(gca,"XMinorTick","off")
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!