Borrar filtros
Borrar filtros

Assign (group-)labels to x-Axis in histogramm / bar chart

2 visualizaciones (últimos 30 días)
Léon
Léon el 9 de Oct. de 2011
Hello,
my data is arranged as a normal vector, whereas the values represent nominal groups. Hence I want to show the group-names instead of the normal x-scale:
data = [1;1;1;2;1;1;2;4;4;4;3;4;2];
xlabel = {'A';'B';'C';'D'}
[n,xout] = hist(data,4)
bar(xout,n)
xlim([1 4])
As you might guess, I wish to label the first bar (representing all 1's) 'A' and so on.
Can somebody give me a hint? THX

Respuestas (0)

Categorías

Más información sobre Histograms 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