HI, I have a question regarding histogram plots in matlab
1 回表示 (過去 30 日間)
古いコメントを表示
Anurag Bhattacharjee
2019 年 8 月 20 日
コメント済み: Anurag Bhattacharjee
2019 年 8 月 20 日
I have a column vector max_ratio that contains values ranging from 0 upto 60. There are roughly 70,000 values inside this vector and almost 69,500 of these values fall within 0 and 10. As a result when I try to plot the histogram the values above 10 don't properly show.
Is there a way to lump the values above 10 together and show it at 10? the values before 10 will show up normally but all the values above 10 will lump together without going further than 10 along x-axis.
I am attaching the code and result I get from it below.
myhist1 = histogram(max_ratio_o,100);
hold on;
BinCenters = (myhist1.BinEdges(2:end)+myhist1.BinEdges(1:end-1))/2;
plot(BinCenters,myhist1.Values,'r-x')
title('Elements in physical space');
xlabel('Max edge length');
ylabel('No. of elements');
0 件のコメント
採用された回答
Ted Shultz
2019 年 8 月 20 日
Yes, use the optional edged arguement of histogram.
you can see more here: histogram doc
edges = [1:9 10];
h = histogram(x,edges);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!