Bar graph grouped bar property

2 visualizaciones (últimos 30 días)
Jared
Jared el 12 de Mzo. de 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 comentarios
Walter Roberson
Walter Roberson el 12 de Mzo. de 2013
Are the data{i} all the same shape? What is size(data) ?
Jared
Jared el 12 de Mzo. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by