A stats.chart.BoxChart holds the data a box chart is drawn from and
the choices it is drawn with, and redraws itself whenever one of them is
set. It is what boxchart returns, and the documented way to reach
it; one is returned per colour group where 'GroupByColor' names
one.
The data comes either from vectors or from a table, never from both, and
the object says which through XDataMode and YDataMode.
Where the data came from vectors these read 'manual' and
XVariable and YVariable are empty; where it came from a
table they read 'auto' and naming a variable is what chooses the
column. Setting YData on an object holding a table is refused, and
so is naming a variable on one holding vectors, as MATLAB R2026a refuses
them. Assigning SourceTable again re-reads the columns, so a table
changed after the chart was drawn is picked up.
The box spans the lower and upper quartiles with the median across it, the
whiskers reach the furthest values within one and a half interquartile
ranges of the box, and whatever lies beyond is drawn as a marker. These
are the quartiles quantile computes and the rule
isoutlier applies with 'quartiles'.
MATLAB’s object carries the properties every graphics object carries,
Annotation and DataTipTemplate among them. This one is a
handle class drawing with ordinary primitives rather than a graphics
object of its own, so it carries what belongs to a box chart and leaves
the rest to the primitives it draws.
hax is the axes to draw into, or empty for the current axes,
which is resolved only once every value has been accepted. spec
is a structure carrying
the data as boxchart resolved it, with the fields
XData, YData, SourceTable, XVariable,
YVariable and XDataMode, and args the
name-value pairs left to set. The documented way to reach this
constructor is boxchart.