How to make a stacked area chart , where x axis is the datetime variable
Mostra commenti meno recenti
I am learning how to draw graphs in Matlab.
I have a problem making stacked area chart. I would like to have on x axis the time and I have the time numbers as my first column of Y matrix, in datenum format. Like this:
Y = [730301, 1, 5, 3;
730302, 3, 2, 7;
730303,1, 5, 3;
730304,2, 6, 1];
If I exclude first column, which are my dates, I can easily plot by:
Y = [1, 5, 3; 3, 2, 7; 1, 5, 3; 2, 6, 1]; figure area(Y)
However, then x axis is not the one I need, and when I am trying to adjust it does not provide a correct view.
this works:
area(y(:,1), y(:,2:end))
However, i want my dates to be in yearly manner represented in graph and not datenum. What to do?
Risposta accettata
Più risposte (1)
the cyclist
il 8 Ago 2017
Modificato: the cyclist
il 8 Ago 2017
0 voti
Categorie
Scopri di più su Dates and Time in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!