![pic11.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/230156/pic11.png)
How do I make 2 bar stacked per month (x-axis)?
2 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I would just like to ask on how can I make a similar plot using MATLAB from the given data I've attached in excel? My goal is to create a plot similar to the figure below which I created initially with Tableau. I came across this forum but it didn't work out well for my plotting(https://uk.mathworks.com/matlabcentral/fileexchange/32884-plot-groups-of-stacked-bars). Thank you for your help. Have a good day.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/230152/image.jpeg)
0 个评论
回答(1 个)
KALYAN ACHARJYA
2019-7-17
编辑:KALYAN ACHARJYA
2019-7-17
Test file is attched.
data=xlsread('sample_file_test.xlsx');
bar(data,'stacked');
![pic11.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/230156/pic11.png)
3 个评论
KALYAN ACHARJYA
2019-7-17
The total number of bar is depends on data (row) in excel file. Number of stack depends on Col in excel file.
Hope it Helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!