Bar graph grouped bar property

1 次查看(过去 30 天)
Jared
Jared 2013-3-12
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 个评论
Walter Roberson
Walter Roberson 2013-3-12
Are the data{i} all the same shape? What is size(data) ?
Jared
Jared 2013-3-12
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by