Dear all,
I have a problem with x-axis intervals. I would like to start the x-axis in 1989 and end in 2018; with 5 years intervals. Here what I've done so far, but it seems xlim not working in this case:
clfstartdate_A = datenum('01-01-1989','dd-mm-yyyy');enddate_A = datenum('01-01-2016','dd-mm-yyyy');dt_A = linspace(startdate_A,enddate_A,336);startdate = datenum('01-01-1989','dd-mm-yyyy');enddate = datenum('01-01-2018','dd-mm-yyyy');dt = linspace(startdate,enddate,360);plot(dt_A,DATA_A,'color','g')datetick('x','yyyy','keepticks')xlim([startdate:5:enddate])hold onplot(dt,DATA_B,'color','b')datetick('x','yyyy','keepticks')
Here is the error:
Error using xlim (line 31)Limits must be a 2-element vector of increasing numeric values.
Thank you so much
Best Answer