Skip to main content

Function: histogramBins()

histogramBins(data, options): HistogramBin[]

Defined in: src/mobjects/graphing/stats.ts:103

Bin raw data into a histogram.

With computed edges, every value lands in a bin and the counts sum to the data length. The last bin includes its right edge. With explicit binEdges, values outside the edge range are dropped.

Parameters​

data​

number[]

options​

HistogramBinsOptions = {}

Returns​

HistogramBin[]

An array of bins, left to right. Empty when data is empty and no explicit edges are given.