How to assign variable width bins in histogram?

I want to plot my data as a histogram but each bar in the histogram has a different bin width given by another data sequence.Thanks.

回答 (1 件)

Guillaume
Guillaume 2017 年 11 月 8 日

1 投票

Calculate the edges of your bins according to your other data sequence, pass that as the second input of histogram.

1 件のコメント

Steven Lord
Steven Lord 2017 年 11 月 8 日
As an example of this technique see the "Specify Bin Edges of Histogram" example in the documentation for the histogram function. In that example there are two very wide bins at the ends of the histogram capturing the outliers in the data.

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

カテゴリ

タグ

質問済み:

2017 年 11 月 8 日

コメント済み:

2017 年 11 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by