File Exchange

image thumbnail

MATLAB Plot Gallery - Stacked Bar Chart

version 1.1.0.2 (26.1 KB) by MathWorks Plot Gallery Team
Create a stacked bar chart

14 Downloads

Updated 19 Dec 2018

View Version History

View License

This is an example of how to create a stacked bar chart in MATLAB®.
Read about the "bar" function in the MATLAB documentation.
For more examples, go to MATLAB Plot Gallery - http://www.mathworks.com/discovery/gallery.html

Cite As

MathWorks Plot Gallery Team (2020). MATLAB Plot Gallery - Stacked Bar Chart (https://www.mathworks.com/matlabcentral/fileexchange/35272-matlab-plot-gallery-stacked-bar-chart), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Timur Kelin

1. The order of of the colours on the bars and on the legend is opposed. This doesn't look nice.
2. Irrespective to this example: 'stack' doesn't work for a stacked single bar. Fake data for the second bar should be added to the input data.

Serena Todd

xyzmrsir

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: superbar

Community Treasure Hunt

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

Start Hunting!