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

77 visualizaciones (últimos 30 días)
Kathleen Miller
Kathleen Miller el 2 de Mzo. de 2016
Editada: Ruben Haverkort el 28 de Mayo de 2021
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?

Respuestas (2)

Mike Garrity
Mike Garrity el 3 de Mzo. de 2016
Have you tried setting the length of the ticks to 0?
set(gca,'TickLength',[0 0])
  2 comentarios
Mr M.
Mr M. el 23 de Jul. de 2018
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 el 28 de Mayo de 2021
Editada: Ruben Haverkort el 28 de Mayo de 2021
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

Iniciar sesión para comentar.


Kathleen Miller
Kathleen Miller el 3 de Mzo. de 2016
Perfect! Thanks so much!

Community Treasure Hunt

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

Start Hunting!

Translated by