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

 Accepted Answer

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

3 Comments

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([])

Sign in to comment.

More Answers (1)

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

Categories

Community Treasure Hunt

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

Start Hunting!