How do I use datetime on the x-axis of the errorplot.
Show older comments
So I have tried this with the normal plot function and then it works, but as I replace plot with errorbar it doesn't work anymore(of course I delete the extra information that is required for the error part of errorbar). This is the error I get when using datetime with errorbar: error using datetime/double (line 1468). Undefined function 'double' for input arguments of type 'datetime'.
Here is a bit of that code:
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'];
datums1 = datetime(datums,'Format','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(datums1,piek1, error1) % gives error
% or plot(datums1,piek1) % this one does work correctly and as I want it to
Is there a way to plot datetime data on the x-axis of a errorbar plot (and still have it be in automatic mode)?
Accepted Answer
More Answers (0)
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!