problem with histogram, adds last bins
Show older comments
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 Comment
pasta pontikaki
on 12 Apr 2019
Edited: pasta pontikaki
on 12 Apr 2019
Answers (0)
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!