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

 Respuesta aceptada

Adam Danz
Adam Danz el 15 de Abr. de 2020

0 votos

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.

Más respuestas (1)

David Hill
David Hill el 15 de Abr. de 2020
Assuming your inputs are a row vectors of the same size.
y=[PSPP',CBPP3',CSPP3',ABSPP'];
bar(y,'stacked');

Categorías

Productos

Etiquetas

Preguntada:

el 15 de Abr. de 2020

Respondida:

el 15 de Abr. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by