What is the difference between bins counts in binscatter and histcounts2?

3 views (last 30 days)
Dear communitty,
can any one explaine why bin counts obtained by binscatter and histcounts2 are slightly different?
This is my code:
y10=log10(y);
h0=binscatter(x,y10,250)
counts_2=get(h0,'Values');
[counts2,xbin,ybin] = histcounts2(x,y10,250);
The data is enclosed to this post.
I compared the max values of the matrixes and they have small difference
max(counts_2(:)) % binscatter
ans =
106
>> max(counts2(:)) % histcounts2
ans =
109
  1 Comment
dpb
dpb on 25 Jun 2021
That file is empty as just noted in other thread...
As for the difference, I'd guess it's how the two deal with either missing or extreme values -- binscatter dives off into a MATLAB graphics primitive without prior calling histcounts2 explicitly in the top-level m-file code and I didn't delve any further.

Sign in to comment.

Answers (0)

Categories

Find more on Data Type Identification in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!