boxplot — Visualize sample quartiles, whiskers, medians, and outliers.
boxplot(x) plots one box for a vector and one box per matrix column. boxplot(x,g) groups vector data by numeric, text, cell, or categorical grouping variables. With an output, RunMat returns a row vector of graphics handles for the line and scatter primitives used to draw the boxes.
Syntax
boxplot(x)
boxplot(x, g)
boxplot(___, Name, Value)
boxplot(ax, ___)
boxplot(ax, x, g, Name, Value)
h = boxplot(___)
h = boxplot(x, g, Name, Value)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
x | NumericArray | Yes | — | Numeric vector or matrix data. |
g | Any | No | — | Grouping vector or cell array of grouping vectors. |
nameValuePairs | Any | Variadic | — | Box plot name-value options. |
ax | AxesHandle | Yes | — | Target axes handle. |
Returns
| Name | Type | Description |
|---|---|---|
h | NumericArray | Row vector of graphics handles for created box plot primitives. |
Returned values from boxplot depend on how many outputs the caller requests.
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:boxplot:InvalidArgument | Inputs, grouping variables, or name-value options are malformed. | boxplot: invalid argument |
RunMat:boxplot:Internal | RunMat cannot construct box statistics or plotting primitives. | boxplot: internal error |
Examples
Plot one box for each matrix column
boxplot([1 10; 2 20; 3 30; 4 40])Plot grouped vector data with labels
h = boxplot([1;2;10;20], {'A';'A';'B';'B'}, 'Labels', {'First','Second'})Plot horizontal boxes with a custom whisker length
boxplot([1;2;3;100], 'Orientation', 'horizontal', 'Whisker', 1)Using boxplot with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how boxplot changes the result.
Run a small boxplot example, explain the result, then change one input and compare the output.
Related Stats functions
Summary
binocdf · cdf · cdfplot · chi2cdf · corr · corrcoef · corrcov · cov · cov2corr · dummyvar · ecdf · filloutliers · fitdist · geomean · grpstats · harmmean · icdf · isoutlier · kstest · kurtosis · lsline · mad · mode · nanmax · normalize · normcdf · norminv · normpdf · onehotdecode · onehotencode · pdf · prctile · quantile · refline · rmse · skewness · tabulate · tcdf · tiedrank · tinv · tpdf · ttest2 · wblinv
Ml
bayesopt · classify · confusionmat · crossvalind · cvpartition · fitclinear · fitctree · fitlm · kmeans · knnsearch · lasso · lassoglm · linkage · lscov · mnrfit · optimizableVariable · pdist · pdist2 · perfcurve · predict · regress · ridge · squareform · test · training · tsne
Random
binornd · bootstrp · datasample · dividerand · exprnd · gamrnd · lhsdesign · mvnrnd · normrnd · random · randsample · rng · trnd · unidrnd · unifrnd · wblrnd
Hist
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.