Bland-Altman and Correlation Plot

Plots a Bland-Altman and correlation plot for two data sets, including data grouping.


Updated 23 Aug 2019

View License

This customizable data analysis tools generates a Bland-Altman and correlation scatter plot. Data can be displayed using color and shape coding of groups using a 2D or 3D matrix notation. Data points can also be displayed using serial numbering, facilitating further interrogation of outliers.
Analysis results (e.g. correlation coefficients, line of best fit, reproducibility coefficient, etc.) can be displayed on the figure. Statistical results are returned as a structured output argument.
An example is included.

Cite As

Ran Klein (2023). Bland-Altman and Correlation Plot (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Fixed non-parametric comparison to use signrank instead of ranked sum (credits to Smilla for bringing this issue to my attention).
Also includes minor comment improvements.

Changes include:
- Explicit support (including demo) for correlation analysis only with correlationPlot.m.
- Improved support for titles and legend with multiple analyses on a figure.
- Legend on/off.
- Text remains on plots when resized.

Corrected code typos as reported by Andrew Stephens. Thank you, Andrew.

Addressed bugs indicated by Rik Wisselink and Cheryl Sital in version 1.7.

Added support for data containing nan values.

Minor comment updates.

Corrected bug with wrong labelling of Bland-Altman x-axis when using data1Mode = 'Truth'.

Added mynum2str and fixed bug with equation option not showing intercept default. Thank you everyone for your comments.

New feature include:
- Parameter-value pair input arguments (incompatible with V1.1).
- Gaussian/non-parametric statistics (including warning for data that may violate this assumption)
- Absolute/relative differences
- Correction of SSE calculation

Added more default colours and the option to specify colours both as code characters and RGB table. See the demo file for and example.