MATLAB: Text instead of values in tick

plottick

How can I have text for example: a,b,c,d instead of 1,2,3,4 in xtick? Matlab always tells me that these values must be numeric…Thanks

Best Answer

set(gca,'xtick',[1 2 3 4],'xticklabel',{'a','b','c','d'})