Function: distplot()
Call Signature
function distplot(samples, labels, options?): ExpressFigure;A distribution plot, like plotly.py's ff.create_distplot(hist_data, group_labels): for each sample set, a histogram (histnorm: 'probability density', bins of binSize from its smallest to largest sample, opacity: 0.7), a curve (Gaussian KDE with Scott's rule, or a fitted normal) on the same axes, and a rug (line-ns-open markers) in a strip below; barmode: 'overlay', the legend in reverse order. Differences from plotly.py: colors default to the template's colorway instead of category10. With an element first, renders it and resolves with the chart.
Parameters
| Parameter | Type |
|---|---|
samples | readonly ArrayLike<number>[] |
labels | readonly string[] |
options? | DistplotOptions |
Returns
Example
const figure = ff.distplot([a, b], ['Group A', 'Group B'], { binSize: 0.25 });Throws
Without samples, with a label count that differs, and (KDE) for a set with fewer than two samples or no spread.
Call Signature
function distplot(el, samples, labels, options?): Promise<Chart>;A distribution plot, like plotly.py's ff.create_distplot(hist_data, group_labels): for each sample set, a histogram (histnorm: 'probability density', bins of binSize from its smallest to largest sample, opacity: 0.7), a curve (Gaussian KDE with Scott's rule, or a fitted normal) on the same axes, and a rug (line-ns-open markers) in a strip below; barmode: 'overlay', the legend in reverse order. Differences from plotly.py: colors default to the template's colorway instead of category10. With an element first, renders it and resolves with the chart.
Parameters
| Parameter | Type |
|---|---|
el | HTMLElement |
samples | readonly ArrayLike<number>[] |
labels | readonly string[] |
options? | DistplotOptions |
Returns
Promise<Chart>
Example
const figure = ff.distplot([a, b], ['Group A', 'Group B'], { binSize: 0.25 });Throws
Without samples, with a label count that differs, and (KDE) for a set with fewer than two samples or no spread.