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 Center および File ExchangeData Distribution Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by