Hey I have plotted a graph but I want to remove the values on the axis, I don't want the numbers to show

 Réponse acceptée

Chenchal
Chenchal le 3 Nov 2017

15 votes

% code
x = rand(1,100);
plot(x);
set(gca,'XTick',[], 'YTick', [])

3 commentaires

ed ro
ed ro le 15 Avr 2020
but I dont want to erase the grid as well... how to just hide the values??
% gca = ax
set(ax,'xticklabel',[])
Paulo Providencia
Paulo Providencia le 10 Mar 2023
I had to use xticklabels([])

Connectez-vous pour commenter.

Plus de réponses (1)

DanielFromIllinois
DanielFromIllinois le 11 Mar 2025

0 votes

set(ax,'xticklabel',[])
You can also use set(ax,'XTick',[]) but then you lose the ability to still turn the xgrid on. The grid will draw lines at your ticks specified by 'XTick'.

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by