I've made a figure with plot(x,y);
Now I'd like only the ticks attached to the ticks on the y-axis to be invisible but not the numbers. Does anyone have such ideas please!!

 채택된 답변

Star Strider
Star Strider 2014년 9월 7일

1 개 추천

You can’t turn the ticks on individual axes on or off, only all of them on or off. Ths solution is to turn all of them off and then add them selectively on the x-axis by plotting them with this:
plot( ... )
hold on
set(gca, 'TickLength',[0 0])
xt = get(gca, 'XTick');
yxt = diff(ylim)
plot([xt; xt], [ones(1,length(xt)); zeros(1,length(xt))]*yxt/100,'k')
hold off
I tested this and it works. If you have any trouble with it in your application, post your code and we’ll get it to work there as well.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 9월 7일

0 개 추천

set(gca,'YTickLabel',[])

댓글 수: 2

Mahesh
Mahesh 2014년 9월 7일
Well, it makes invisible both tick and number. I mean just the tick. Thanks for response
Image Analyst
Image Analyst 2014년 9월 8일
Why? What good are numbers without the tick mark? It's less precise.

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

카테고리

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

질문:

2014년 9월 7일

댓글:

2014년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by