How do i make ticks invisible
33 次查看(过去 30 天)
显示 更早的评论
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!!
0 个评论
采纳的回答
Star Strider
2014-9-7
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.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!