How do I display the bin count of each bar at the top of each histogram bar?

11 ビュー (過去 30 日間)
jim scherr
jim scherr 2018 年 7 月 11 日
コメント済み: Thomas Lutz 2023 年 1 月 25 日
I'm using the histogram function to display a histogram. How do I display the bin count of each bar at the top of each histogram bar?

採用された回答

KSSV
KSSV 2018 年 7 月 11 日
x = randn(10000,1);
h = histogram(x) ;
x = h.BinEdges ;
y = h.Values ;
text(x(1:end-1),y,num2str(y'),'vert','bottom','horiz','center');
box off
  3 件のコメント
parag patil
parag patil 2020 年 8 月 10 日
How to do this for categorical data ?
Thomas Lutz
Thomas Lutz 2023 年 1 月 25 日
How to do this for categorical data ?

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by