Histogram set custom DisplayOrder
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

