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

 채택된 답변

Chenchal
Chenchal 2017년 11월 3일

15 개 추천

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

댓글 수: 3

ed ro
ed ro 2020년 4월 15일
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 2023년 3월 10일
I had to use xticklabels([])

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

DanielFromIllinois
DanielFromIllinois 2025년 3월 11일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2017년 11월 3일

답변:

2025년 3월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by