Visualization of correlation matrix: mycorrplot_1, mycorrplot_2

version (15.6 KB) by Wei-Ting Lin
Plot the results of correlation (i.e. corr(X), corr(X,Y)) in a figure with table-like structure.


Updated 21 Nov 2015

View License

mycorrplot_1.m : display result of corr(X)
mycorrplot_2.m : display result of corr(X,Y))
Documentation can be found on

R values and Significance levels (range of P values) are visualized as the color and sizes of circle. User can also chose to see scatter plots, and/or text with R and P values on one triangle. Rows with NaN will be removed for each pair of variables. Input can be matrix or table.

Inspired by :
corrplot : from Matlab econometrics tool box
correlationCircles by David Legland
R package corrplot

Depend on :
Matlab Statistics and Machine Learning Toolbox
my functions: plot_circle.m, mycolor.m, nancorr.m, tnames.m

Cite As

Wei-Ting Lin (2022). Visualization of correlation matrix: mycorrplot_1, mycorrplot_2 (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
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!