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

 Akzeptierte Antwort

Chenchal
Chenchal am 3 Nov. 2017

15 Stimmen

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

3 Kommentare

ed ro
ed ro am 15 Apr. 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 am 10 Mär. 2023
I had to use xticklabels([])

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

DanielFromIllinois
DanielFromIllinois am 11 Mär. 2025

0 Stimmen

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'.

Kategorien

Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by