How to display only selected xticks?
조회 수: 22 (최근 30일)
이전 댓글 표시
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/544462/image.jpeg)
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에서 Axes Appearance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!