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

NameTypeRequiredDefaultDescription
xNumericArrayYesNumeric vector or matrix data.
gAnyNoGrouping vector or cell array of grouping vectors.
nameValuePairsAnyVariadicBox plot name-value options.
axAxesHandleYesTarget axes handle.

Returns

NameTypeDescription
hNumericArrayRow vector of graphics handles for created box plot primitives.

Returned values from boxplot depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:boxplot:InvalidArgumentInputs, grouping variables, or name-value options are malformed.boxplot: invalid argument
RunMat:boxplot:InternalRunMat 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.

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.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.