Plot Data into a Histogramm
1 view (last 30 days)
Show older comments
Hello,
i have written this script:
a = exprnd(200, 100, 1);
small = find( a < 57 );
a ( small ) = 57;
classification = zeros( 100,1 );
edges = [57 66.51 84.51 111.51 145.01 180.01 224.91 1000]
for k = 1:length(a)
for m = 1:length(edges)
if a(k) >= edges(m) && a(k) < edges(m+1)
classification(k) = m;
end
end
end
C = categorical(classification,[1 2 3 4 5 6 7],{'WG1','WG2','WG3','WG4','WG5','WG6','WG7'})
h = histogram(C,'BarWidth',0.9)
And i have plottet my data into a Histogram.
My question: Is my histogram ok?
Because i thought that in a histogram the most frequent data must be in the middle? And not on the right side...
0 Comments
Answers (1)
KALYAN ACHARJYA
on 2 Apr 2020
"My question: Is my histogram ok?"
Ans: OK, as per your data
"Because i thought that in a histogram the most frequent data must be in the middle? And not on the right side..."
No, the shape of the histogram plot purely depends on the what type of data value. Its just the plot the bins along with occurance of number (events)
See Also
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!