MATLAB: How to make axis line invisible but keep xlabel and ylabel

axisimagescplotvisible

I tried axis off, or set(gca,'xcolor','w'), but the problem is I want to keep the xlabel, morover white color is not good for me, because I am using imagesc and white ticks are visible on the colored figure.

Best Answer

h=get(gca);
set(h,'xcolor','none')
h.XAxis.Label.Color=[0 0 0];
h.XAxis.Label.Visible='on';