Histogram set custom DisplayOrder
이전 댓글 표시
I created a histogram from data I extracted from a table. The input is as displayed in "size".
size = ["large" "xlarge" "small" "small" "medium" "large" "xlarge" "small" "medium" "medium" "xlarge"];
C = categorical(size);
h = histogram(C);
% right order would be:
X = [4 1 2 3];
Y = ["xlarge" "small" "medium" "large"];
[Xsorted,I] = sort(X);
Ysorted = Y(I);
%h.DisplayOrder = Ysorted;
This plot is what I get:

The command DisplayOrder only regognizes 'descend' or 'ascend'. As default the data is in order of the input data.
Is there a possibility to order the data according to Y?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


