How to remove certain tick labels from xaxis in line plot
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I've been graphing this line plot. Currently my x-axis has tick labels from 0 to 3000 seconds in 500 second intervals as shown below. How can I remove all the x-axis tick labels except for the label at 3000? Thanks.

0 件のコメント
採用された回答
Star Strider
2022 年 7 月 12 日
Try something like this —
t = linspace(0, 3000, 3000);
s = (sin(2*pi*t*5)>0.9)*6.8 + 0.1;
figure
plot(t, s)
figure
plot(t, s)
xt = xticks;
set(gca,'XTick',max(xt));
.
0 件のコメント
その他の回答 (1 件)
Anay Aggarwal
2022 年 7 月 12 日
Hi Aaron,
I have an understanding that you want to remove tick labels from the x-axis.
Please refer to the following page for details.
Regards
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!