MATLAB: How to make the following plot

MATLABplotplotting

Suppose I have time series for PSPP, CBPP3, CSPP, ABSPP. How would you make a plot that looks like the one above?

Best Answer

Use bar(x, y, 'stacked') where x are datetime values (or integers for years) and y is a matrix where each row defines the stacked values for 1 bar. There's a example of a stacked bar chart in within the link.