how to label multiple bars within the same x-value
Show older comments
Hej im trying to create a plot of some testvalues, and i simply cant figure out a way to label multiple bars within the same x-value.
The test data comes out in a 6 x M matrix telling the time datacollection time and a 4 x M matrix with the testdata were each column is zone1, zone2, zone3 and zone4.
i've tried this so far:
Zones={'zone1','zone2','zone3','zone4'};
X=tvec_a(:,4);
Y=data_a;
bar(X,Y,1)
set(gca,'xticklabel',Zones)
title('Hourly consumption')
xlabel('Hour')
ylabel('Consumption')
But this simply output all four columns with the same same instead of each column was devided into zones for each x-val:

Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Signal Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
