docs-v2/content/v2.0/reference/flux/functions/built-in/misc/linearbins.md

1.1 KiB

title description aliases menu weight
linearBins() function The `linearBins()` function generates a list of linearly separated floats.
/v2.0/reference/flux/functions/misc/linearbins
v2_0_ref
name parent
linearBins built-in-misc
401

The linearBins() function generates a list of linearly separated floats. It is a helper function meant to generate bin bounds for the histogram() function.

Function type: Miscellaneous
Output data type: Array of floats

linearBins(start: 0.0, width: 5.0, count: 20, infinity: true)

Parameters

start

The first value in the returned list.

Data type: Float

width

The distance between subsequent bin values.

Data type: Float

count

The number of bins to create.

Data type: Integer

infinity

When true, adds an additional bin with a value of positive infinity. Defaults to true.

Data type: Boolean

Examples

linearBins(start: 0.0, width: 10.0, count: 10)

// Generated list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, +Inf]