Removing Xaxis and Yaxis values

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

 Risposta accettata

Chenchal
Chenchal il 3 Nov 2017
% code
x = rand(1,100);
plot(x);
set(gca,'XTick',[], 'YTick', [])

3 Commenti

ed ro
ed ro il 15 Apr 2020
but I dont want to erase the grid as well... how to just hide the values??
% gca = ax
set(ax,'xticklabel',[])
I had to use xticklabels([])

Accedi per commentare.

Più risposte (1)

DanielFromIllinois
DanielFromIllinois il 11 Mar 2025

0 voti

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

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by