Is it possible to change label names in Matlab
이전 댓글 표시
I want to have different names in my Y axis rather than numbering like the following photo:

채택된 답변
추가 답변 (3개)
Sean de Wolski
2015년 6월 24일
Adjust the axes' 'YTickLabel' property:
barh(rand(3,1));
ax = gca;
ax.YTickLabel = {'Hello','World','Wednesday'}
Chad Greene
2015년 6월 24일
plot(1:9,1:9)
set(gca,'ytick',1:9,'yticklabel',{'book','pen','vb','top','red','green','black','green','verb'})
Azzi Abdelmalek
2015년 6월 24일
t=0:10;
y=sin(t)
plot(y)
s={'a' 'b' 'c' 'd' 'e' 'f'}
yt=get(gca,'ytick')
n=numel(s)
set(gca,'xtick',linspace(min(yt),max(xt),n),'yticklabel',s')
카테고리
도움말 센터 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
