docs-v2/content/flux/v0.x/stdlib/universe/logarithmicbins.md

1.3 KiB

title description aliases menu weight
logarithmicBins() function The `logarithmicBins()` function generates a list of exponentially separated floats.
/influxdb/v2.0/reference/flux/functions/misc/logarithmicbins
/influxdb/v2.0/reference/flux/functions/built-in/misc/logarithmicbins/
/influxdb/v2.0/reference/flux/stdlib/built-in/misc/logarithmicbins/
/influxdb/cloud/reference/flux/stdlib/built-in/misc/logarithmicbins/
flux_0_x_ref
name parent
logarithmicBins universe
102

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

Output data type: Array of floats

logarithmicBins(
    start:1.0, 
    factor: 2.0, 
    count: 10, 
    infinity: true,
)

Parameters

start

The first value in the returned bin list.

factor

The multiplier applied to each subsequent bin.

count

The number of bins to create.

infinity

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

Examples

logarithmicBins(start: 1.0, factor: 2.0, count: 10, infinity: true)

// Generated list: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, +Inf]