problem with histogram, adds last bins

1 回表示 (過去 30 日間)
pasta pontikaki
pasta pontikaki 2019 年 4 月 12 日
編集済み: pasta pontikaki 2019 年 4 月 12 日
Hi all, i have this histogram which on x-axis have values from angles -90:90 and i also have a threshold thresh= -4
I want to split the histogram into two. The one down form the thresh and the other upper the thresh, so i write the above code:
>> h1=histogram([lines.theta],'BinEdges', -90 : thresh ,'EdgeColor','r');
The problem is tha the last bin is added with the previous one.
For example :
the bin -6 has value 8 which is correct,
the bin -5 has value 13 but the histogram shows that has round 23 because it adds the bins of -5 and the bins of -4. Bin -4 has value 10 so 10+13.
This is happenig whatever right limiit of histogram is. The last bin it is added with the previous one
Has anyone any idea why this is happening?
Also do you know how to put the edges of x-axis under each bin? Because as you can see histogram displays now the range each bin.
  1 件のコメント
pasta pontikaki
pasta pontikaki 2019 年 4 月 12 日
編集済み: pasta pontikaki 2019 年 4 月 12 日
I have the same problem if i use the hist function , not the histogram.
The sub histogram extends from -90:-5
On value -5 the count is 13 but as you can see the result is an inconceivable number =1616

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by