Bar graph grouped bar property

1 view (last 30 days)
Jared
Jared on 12 Mar 2013
I'm trying to plot several data series in a bar graph, and group the bars. However, when I use the below code, the bars are overlapped and not grouped.
for i=1:5
h(i)=bar(0:10,histc(data{i},0:10),'grouped');
set('MarkerEdgeColor,color{i},'MarkerFaceColor',color{i})
end
  2 Comments
Walter Roberson
Walter Roberson on 12 Mar 2013
Are the data{i} all the same shape? What is size(data) ?
Jared
Jared on 12 Mar 2013
data{i} are all 1 dimensional vectors of counts of whole number values, ranging from 0 to 10. For example, data{1}=[0 1 1 2 2 2 2 8 10 10 10] etc. They are vary in length. I take a histogram of these values, and put the counts into 10 bins. What I'm trying to do is this: Say i=3. I want to have 3 bars, representing the counts of each data set, at each value (0-10). I also want to be able to set the colors of each data set, as well as the legend labels.
Thanks

Sign in to comment.

Answers (0)

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!