Create a stacked bar chart in matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
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!