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

 Respuesta aceptada

Chenchal
Chenchal el 3 de Nov. de 2017

15 votos

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

3 comentarios

ed ro
ed ro el 15 de Abr. de 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 el 10 de Mzo. de 2023
I had to use xticklabels([])

Iniciar sesión para comentar.

Más respuestas (1)

DanielFromIllinois
DanielFromIllinois el 11 de Mzo. de 2025

0 votos

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

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Nov. de 2017

Respondida:

el 11 de Mzo. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by