Reputation: 291
I have used the following codes:
bar([c f], 0.1,'stacked');
and
bar( [c , f ] , 1.5);
whose results are:
What I am confused is that the values are not the same can you explain what is happening?
is it now correct?
bar( [c , c+f ] , 0.5);
Upvotes: 0
Views: 56
Reputation: 14937
The stacked version shows the first vector on the bottom, in blue, and the second vector "stacked" on top of the first, in red. The idea is that the total is the most important visual value, but you can also see the independent contributions of the inputs. So yes, the c+f plot should resemble the stacked plot, in that the bars should be the same height. The only difference is that the stacked plot shows c and f in the same bar. Is that clear?
Upvotes: 1