qqplot — Create a quantile-quantile plot against a normal distribution or another sample.
qqplot(x) plots sorted sample quantiles against standard-normal theoretical quantiles. qqplot(x,y) compares the quantiles of two samples. qqplot(x,[],pvec) and qqplot(x,y,pvec) evaluate quantiles at explicit percentage values in the interval [0,100]. Matrix inputs create one series per column, omitting NaN and Inf observations.
Syntax
qqplot(x)
qqplot(x, y)
qqplot(x, y, pvec)
qqplot(ax, ___)
h = qqplot(___)
h = qqplot(x, y, pvec)
h = qqplot(ax, ___)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
x | NumericArray | Yes | — | Sample data vector or matrix. |
y | NumericArray | No | — | Optional comparison sample data vector. |
pvec | NumericArray | No | — | Optional quantile percentages in the closed interval [0, 100]. |
ax | AxesHandle | Yes | — | Target axes handle. |
Returns
| Name | Type | Description |
|---|---|---|
h | NumericArray | Line handles for the quantile points, quartile line, and fitted reference line. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:qqplot:InvalidArgument | Inputs, probabilities, or axes handles are malformed. | qqplot: invalid argument |
RunMat:qqplot:Internal | RunMat cannot construct quantile pairs or plotting primitives. | qqplot: internal error |
Examples
Normal quantile plot
h = qqplot([1; 2; 4; 8])Expected output:
h is a 3-by-1 vector of line handles.Use explicit probabilities
h = qqplot([0; 10; 20], [], [25 50 75]);
y = get(h(1), 'YData')Expected output:
y is [5 10 15].Compare two samples
h = qqplot([1; 3; 5], [2; 4; 6], 50)Expected output:
The plotted point compares median quantiles 3 and 4.Using qqplot with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how qqplot changes the result.
Run a small qqplot example, explain the result, then change one input and compare the output.
Related functions
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.