Azzera filtri
Azzera filtri

Bar graph grouped bar property

1 visualizzazione (ultimi 30 giorni)
Jared
Jared il 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 Commenti
Walter Roberson
Walter Roberson il 12 Mar 2013
Are the data{i} all the same shape? What is size(data) ?
Jared
Jared il 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

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by