フィルターのクリア

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

2 ビュー (過去 30 日間)
Léon
Léon 2011 年 10 月 9 日
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

回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by