How to remove the tic labels but not the marks?

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일

6 개 추천

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.

추가 답변 (3개)

Elias Gule
Elias Gule 2015년 3월 11일

1 개 추천

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

1 개 추천

%%To remove tick marks on the y-axis
tickMarks = {'YTick',[]};
set(gca,tickMarks{:});

카테고리

질문:

2015년 3월 11일

편집:

2021년 8월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by