Some plot functions don’t work and play well with datetime objects for some reason. A work-around is to use the datenum and datetick functions:
datums = ['25-09-2015'; '01-10-2015'; '06-10-2015'; '08-10-2015'; '15-10-2015'; '20-10-2015'; '21-10-2015'; '26-10-2015'; '27-10-2015';'28-10-2015'];
datnms = datenum(datums,'dd-mm-yyyy');
piek1 = [-4;-5;-6;-8;-1;-2;-4;-3;-4;-5];
error1 = [0.3960; 0.5300; 0.4830; 0.1800; 0.2330; 0.4210; 0.5910; 1.0170; 1.6480; 0.7370];
figure(1)
errorbar(datnms,piek1, error1)
datetick('x', 'dd-mm-yyyy')
You also had an error in your date format. The two-digit ‘month’ format is 'mm', minutes is 'MM'. (I fixed those here.)
Best Answer