How to remove XTick labels without removing XGrid lines?
369 ビュー (過去 30 日間)
古いコメントを表示
Hello
Is it possible to remove the XTick labels in a figure without also removing the XGrid lines? Thereby having a figure with only YTicks labels but with both X- and YGrid lines?
0 件のコメント
採用された回答
Wayne King
2011 年 9 月 27 日
Hi, one way:
plot(randn(100,1));
grid on;
set(gca,'xticklabel',{[]})
1 件のコメント
Wayne King
2011 年 9 月 27 日
Actually, in deference to Daniel, I didn't need to put the empty brackets inside a cell array. set(gca,'xticklabel',[]) works just fine. Sometimes my fingers are detached from my brain. The braces look more artsy, but not needed :)
その他の回答 (2 件)
Javier Sarmiento
2016 年 4 月 14 日
編集済み: Javier Sarmiento
2016 年 4 月 14 日
Hi Morten, complementing the answer given by Wayne, you can choose which grid is with tick and which not by editing these one by one:
set(gca,'xticklabel',{'' [10 20] ''})
The result is two empty ticks (also two ticks with 10 and 20) with grids.
Best regards!
Javier
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!