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?
Best Answer