Filter löschen
Filter löschen

How to remove the tic labels but not the marks?

703 Ansichten (letzte 30 Tage)
Mr M.
Mr M. am 11 Mär. 2015
Bearbeitet: Walter Roberson am 21 Aug. 2021
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.

Akzeptierte Antwort

Joseph Cheng
Joseph Cheng am 11 Mär. 2015
Bearbeitet: Joseph Cheng am 11 Mär. 2015
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.

Weitere Antworten (3)

Elias Gule
Elias Gule am 11 Mär. 2015
%%Remove tick labels for the X and Y axes
tickCell = {'XTickLabel',{},'YTickLabel',{}};
set(gca,tickCell{:});

Elias Gule
Elias Gule am 11 Mär. 2015
%%To remove tick marks on the y-axis
tickMarks = {'YTick',[]};
set(gca,tickMarks{:});

Sergio Yanez-Pagans
Sergio Yanez-Pagans am 21 Aug. 2021
Bearbeitet: Walter Roberson am 21 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by