Type Alias: BoxTrace
ts
type BoxTrace = CommonTraceAttributes & CartesianTraceAttributes & object;Box plot: quartiles, median, whiskers and outliers of samples (or of precomputed statistics) at each position.
Type Declaration
| Name | Type | Description |
|---|---|---|
alignmentgroup? | string | Traces on the same position axis with the same alignment group split each position between their offset groups; different alignment groups lay out independently. |
boxmean? | true | "sd" | false | Draw the mean as a dashed line (true), plus a dashed diamond spanning ± sdmultiple standard deviations ('sd'). Default: on with precomputed mean (and 'sd' with sd). |
boxpoints? | "all" | "outliers" | "suspectedoutliers" | false | Which samples are drawn as points: 'all', only those beyond the whiskers ('outliers', the default), those plus a highlight of the ones between the whiskers and 3 IQR from the quartiles ('suspectedoutliers', styled by marker.outliercolor and marker.line.outlier*), or none (false, the whiskers then reach the extreme samples). Default: 'suspectedoutliers' when an outlier color is set, 'all' with precomputed statistics, else 'outliers'. |
dx? | number | Step between the positions of precomputed boxes when x is not given: box i is at x0 + i·dx. Default 1. |
dy? | number | Step between the positions of precomputed horizontal boxes when y is not given. Default 1. |
fillcolor? | string | Fill color of the box. Default: line.color at half opacity. |
hoveron? | "boxes" | "points" | "boxes+points" | "points+boxes" | What shows hover labels: the boxes (one label per statistic, as Plotly), the points, or both (a point under the pointer wins). |
jitter? | number | Random spread of the points across the position axis, as a fraction of the box width (0: all on one line). Denser stretches spread more. Default: 0.3 with boxpoints: 'all', else 0. The spread is repeatable (Plotly's seeded generator). Range: 0 – 1 |
line? | BoxTraceLine | Outline of the box. |
lowerfence? | DataColumn | Precomputed lower whisker ends, one per box. Default: the lowest sample within 1.5 IQR of q1 when samples are given, else q1. |
marker? | BoxTraceMarker | Style of the sample points. |
mean? | DataColumn | Precomputed means, one per box (turns boxmean on by default). Default: the sample mean, else (q1 + q3) / 2. |
median? | DataColumn | Precomputed medians, one per box. |
notched? | boolean | Draw notches at the median's 95% confidence interval (median ± 1.57 · IQR / √n): boxes whose notches don't overlap have different medians with roughly 95% confidence. Default: true when notchwidth (or notchspan) is set. |
notchspan? | DataColumn | Precomputed notch half-heights, one per box (turns notched on by default). Default: 1.57 · IQR / √n. |
notchwidth? | number | How far notches cut into the box, as a fraction of its width (0–0.5). Range: 0 – 0.5 |
offsetgroup? | string | With layout.boxmode: 'group', traces with the same offset group share one slot at each position; different offset groups sit side by side. |
orientation? | "v" | "h" | 'v': vertical boxes at x positions over y values; 'h': horizontal ones at y positions. Default: 'v' when y is given, else 'h'. |
pointpos? | number | Where the points sit relative to the box, in box half-widths: 0 on its center line, 1 on its right (or top) edge, −2 one box width to the left (or below). Default: −1.5 with boxpoints: 'all', else 0. Range: -2 – 2 |
q1? | DataColumn | Precomputed first quartiles, one per box. With median and q3, switches the trace to precomputed statistics. |
q3? | DataColumn | Precomputed third quartiles, one per box. |
quartilemethod? | "linear" | "exclusive" | "inclusive" | How quartiles are computed from samples: linear interpolates over the whole sample (Plotly's method, the one most tools call type 5); for odd counts, exclusive takes the medians of the lower and upper halves without the median, inclusive with it. Even counts use linear in every method. |
sd? | DataColumn | Precomputed standard deviations, one per box (with mean, makes boxmean: 'sd' the default). Default: the sample standard deviation, else q3 − q1. |
sdmultiple? | number | How many standard deviations the sizemode: 'sd' box and the boxmean: 'sd' diamond span on each side of the mean. Minimum: 0 |
selected? | BoxTraceSelected | Style of selected points while a selection is active. |
showwhiskers? | boolean | Draw the whiskers. Default: true, except with sizemode: 'sd'. |
sizemode? | "quartiles" | "sd" | 'quartiles': the box spans q1–q3 with a line at the median; 'sd': it spans mean ± sdmultiple standard deviations with a line at the mean (no whiskers by default). |
text? | PerPoint<string | number> | Text per sample, shown in the hover label of its point. |
type | "box" | Trace type. |
unselected? | BoxTraceUnselected | Style of unselected points while a selection is active. |
upperfence? | DataColumn | Precomputed upper whisker ends, one per box. Default: the highest sample within 1.5 IQR of q3 when samples are given, else q3. |
whiskerwidth? | number | Width of the whisker caps as a fraction of the box width (0: no caps). Range: 0 – 1 |
width? | number | Box width in position-axis units (category slots, or ms on date axes). 0 (default): computed from the spacing of the positions and layout.boxgap, boxgroupgap and boxmode. Minimum: 0 |
x? | DataColumn | x samples: the values of horizontal boxes when y is not given, else the position of each sample (one box per distinct x) for vertical boxes. With precomputed statistics (q1, median, q3): the position of each box, or one sample array per box on the value axis. |
x0? | unknown | Position of the box when x is not given. Default: the trace name on category axes (and numeric or date names on linear, log and date axes), else the box's index among the box traces. |
y? | DataColumn | y samples: the values of horizontal boxes when x is not given, else the position of each sample (one box per distinct y) for vertical boxes. With precomputed statistics (q1, median, q3): the position of each box, or one sample array per box on the value axis. |
y0? | unknown | Position of the box when y is not given. Default: the trace name on category axes (and numeric or date names on linear, log and date axes), else the box's index among the box traces. |
zorder? | number | Stacking order among the traces of a subplot: higher is drawn on top. At equal zorder, violins draw below boxes and both below scatter traces (Plotly’s layer order), then in trace order. |