Assign (group-)labels to x-Axis in histogramm / bar chart
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!