Plot Data into a Histogramm
4 ビュー (過去 30 日間)
古いコメントを表示
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/281440/image.jpeg)
Because i thought that in a histogram the most frequent data must be in the middle? And not on the right side...
0 件のコメント
回答 (1 件)
KALYAN ACHARJYA
2020 年 4 月 2 日
"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)
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!