Bar graph and "stacked" options.
1 次查看(过去 30 天)
显示 更早的评论
I would like to obtain a bar graph with olnly some data showed as stacked.
For example consider this script.
A=[1 2 3; 2 5 3; 1 4 3];
bar (A)
I can obtain a also this type of graph with 'stacked' bars
bar(A,'stacked')
I would like to obtain a graph in wich only some data are stacked.
For example the first elements of A should appear "1" as alone bar and "2 ,3" stacked with different coulors. how can i do it?
I tryed this but it dosent work.
bar(A(1,1), A(1,2:3),'stacked')
0 个评论
采纳的回答
Constantino Carlos Reyes-Aldasoro
2022-7-5
This is solved easily by adding zeros in the columns that you do not want a stack, e.g.
bar ( [1 2 3;0 2 3;0 0 6]','stacked')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!