vega-lite-api

vl.density(density)

Estimate smoothed densities for numeric values.

density Method Overview

density API Reference

# density.as(…value)

The output fields for the sample value and corresponding density estimate.

Default value: ["value", "density"]

# density.bandwidth(value)

The bandwidth (standard deviation) of the Gaussian kernel. If unspecified or set to zero, the bandwidth value is automatically estimated from the input data using Scott’s rule.

# density.counts(value)

A boolean flag indicating if the output values should be probability estimates (false) or smoothed counts (true).

Default value: false

# density.cumulative(value)

A boolean flag indicating whether to produce density estimates (false) or cumulative density estimates (true).

Default value: false

# density.density(value)

The data field for which to perform density estimation.

# density.extent(…value)

A [min, max] domain from which to sample the distribution. If unspecified, the extent will be determined by the observed minimum and maximum values of the density value field.

# density.groupby(…value)

The data fields to group by. If not specified, a single group containing all data objects will be used.

# density.maxsteps(value)

The maximum number of samples to take along the extent domain for plotting the density.

Default value: 200

# density.minsteps(value)

The minimum number of samples to take along the extent domain for plotting the density.

Default value: 25

# density.steps(value)

The exact number of samples to take along the extent domain for plotting the density. If specified, overrides both minsteps and maxsteps to set an exact number of uniform samples. Potentially useful in conjunction with a fixed extent to ensure consistent sample points for stacked densities.