Hist vs Histogram (Different output even if same bins and same dataset)
8 views (last 30 days)
Show older comments
Why does hist and histogram output different graphs even if they have the same bins and the same dataset?
Which is considered more accurate?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1296065/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1296070/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1296075/image.jpeg)
0 Comments
Answers (1)
Mili Goyal
on 21 Feb 2023
Edited: Mili Goyal
on 21 Feb 2023
The "hist" function operates with bin centers while "histogram" operates with bin edges. The details of the differences between the two can be found in the following documentation:
The "histogram" function includes various improvements over "hist" and is the new recommended function.
Hope this helps!
0 Comments
See Also
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!