How can one remove axis ticks on imagesc but keep labels?

조회 수: 48 (최근 30일)
Kathleen Miller
Kathleen Miller 2016년 3월 2일
편집: Ruben Haverkort 2021년 5월 28일
I am trying to remove the physical tick marks from imagesc on both the x and y axes, but have labels for both axes I want to keep. Is there a way to remove the ticks, or control the size of them so they are virtually invisible?

답변 (2개)

Mike Garrity
Mike Garrity 2016년 3월 3일
Have you tried setting the length of the ticks to 0?
set(gca,'TickLength',[0 0])
  댓글 수: 2
Mr M.
Mr M. 2018년 7월 23일
I have the same problem, but I do not need the axis lines, nor ticks, but I want to keep the xlabel and ylabel. How to do this?
Ruben Haverkort
Ruben Haverkort 2021년 5월 28일
편집: Ruben Haverkort 2021년 5월 28일
Hi Mr M.
This answer is probably a bit late for you, but maybe somebody else googling this topic might benefit.
To remove the 'axis lines', use
grid off

댓글을 달려면 로그인하십시오.


Kathleen Miller
Kathleen Miller 2016년 3월 3일
Perfect! Thanks so much!

카테고리

Help CenterFile Exchange에서 Formatting and Annotation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by