How to remove the tic labels but not the marks?

675 ビュー (過去 30 日間)
Mr M.
Mr M. 2015 年 3 月 11 日
編集済み: Walter Roberson 2021 年 8 月 21 日
I would like to remove tick marks on the y-axis but not on the x-axes. And I want to remove the labels (numbers) of all ticks.

採用された回答

Joseph Cheng
Joseph Cheng 2015 年 3 月 11 日
編集済み: Joseph Cheng 2015 年 3 月 11 日
what you could do is use the set command for the axis. like
set(gca,'YTick',[]); %which will get rid of all the markings for the y axis
or
set(gca,'Yticklabel',[])
set(gca,'Xticklabel',[]) %to just get rid of the numbers but leave the ticks.
  1 件のコメント
Wenfang Zhang
Wenfang Zhang 2021 年 3 月 18 日
Great! Thanks!

サインインしてコメントする。

その他の回答 (3 件)

Elias Gule
Elias Gule 2015 年 3 月 11 日
%%Remove tick labels for the X and Y axes
tickCell = {'XTickLabel',{},'YTickLabel',{}};
set(gca,tickCell{:});

Elias Gule
Elias Gule 2015 年 3 月 11 日
%%To remove tick marks on the y-axis
tickMarks = {'YTick',[]};
set(gca,tickMarks{:});

Sergio Yanez-Pagans
Sergio Yanez-Pagans 2021 年 8 月 21 日
編集済み: Walter Roberson 2021 年 8 月 21 日

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by