MATLAB: Set limits using xlim for strings

xlim

Hi, I wanted to know how to set string limits for a graph. I wanted to set axis limits as months of a year ('Jan' 'Feb 'Mar'). Also wanted to know whether I can pass an array or pass variable with predefined values in the xlim function. Thanks in advance.

Best Answer

set(gca,'XTick',1:12,'XTickLabel',{'Jan','Feb','Mar','Apr' .... etc})