MATLAB: How to tick out yearly outtickyearly Hi Does anyone knows how to tick out yearly? I am using set(gca,'TickDir','out'); it is working but my ticks is appearing in every 10 years. I need ticks out yearly. So how do I tick out yearly? Thanks! Best Answer Look at this exampled=datenum('01-01-2015'):datenum('01-01-2035');y=log(d);plot(d,y)a=datevec(d);[ii,jj]=unique(a(:,1));set(gca,'xtick',d(jj))datetick('x','yyyy','keepticks') Related SolutionsMATLAB: Deletting X and Y axes ticks set(gca,'xtick',[]) set(gca,'ytick',[]) MATLAB: How to tick out several types in one graph doc XTickdoc XTickLabel Related QuestionAdd more tick labels to a datenum graphI want to create a curve on the histogramRemove gridline from plot
Best Answer