MATLAB Answers

Create a stacked bar chart in matlab

9 views (last 30 days)
Andrew Alkiviades
Andrew Alkiviades on 13 Apr 2013
Hi, I am trying to create a stacked bar chart in matlab. All I am trying to do is have the two data sets I am plotting on the same bar in different colours.
What seems to be happening with my code below is that the data sets are adding up thus even though the difference is the correct value, the absolute number is not. can this be avoided?
my code is
%%AD STACKED CC %%
AD_monthly_generation_250 = [186 186 186 186 186 186 186 186 186 186 186 186]';
CC_monthly_demand_2012 = [199.575 206.701 145.284 135.944 127.689 93.281 80.311 78.859 98.145 168.572 206.365 113.030]';
% Create a stacked bar chart using the bar function
figure;
bar(1:12, [ AD_monthly_generation_250 CC_monthly_demand_2012 ], 0.5, 'stack');

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.


Translated by