problem with histogram, adds last bins

조회 수: 3 (최근 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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by