Stacked bar chart similar to Excel
Mostra commenti meno recenti
Hi
I have the attached Excel sheet contains data to plot a stacked bar chart.
I want to plot it like the below picture from Excel:

Can I do that in MATLAB please?
Thanks
Risposta accettata
Più risposte (1)
Devanuj Deka
il 15 Lug 2021
Modificato: Devanuj Deka
il 15 Lug 2021
0 voti
Yes, you can. MATLAB's bar function has an optional style parameter that you can use to display stacked bar chart. Here is the documentation: bar(___,style)
If you specify the style parameter as 'stacked', you can create a stacked bar chart. For more information: style
2 Commenti
AHMED FAKHRI
il 15 Lug 2021
Devanuj Deka
il 16 Lug 2021
Modificato: Devanuj Deka
il 16 Lug 2021
@AHMED FAKHRI, I have posted another answer with a code. Please check that out and let me know if you can work with this.
Categorie
Scopri di più su Discrete Data Plots 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!




