Correlogram

Visualize correlation matrix using correlogram
204 Downloads
Updated 17 Aug 2023

View License

The correlogram function efficiently generates plots to visualize the correlation matrices. It displays correlation values as a heatmap in the bottom left, using color gradients to indicate the strength of association, and as pie charts in the top right, providing a quick overview. By default, sorting is enabled, arranging variables by performing an agglomerative hierarchical clustering with the linkage function. This function can help in quickly visualizing possible associations between variables, making data interpretation easier.
Example Usage:
% Load the example dataset and compute correlation matrix
D = load('accidents.mat');
C = corr(D.hwydata);
axislabels = D.hwyheaders;
% Prepare the figure and set the size
figure(1); clf();
set(gcf, 'Position', [0 0 1080 640]); movegui('center');
% Draw the correlogram
correlogram(C, 'AxisLabels', axislabels);
Use Original Ordering :
% Nodes as sorted by default, set 'Sorting' false to disable it
figure(2); clf();
set(gcf, 'Position', [0 0 1080 640]); movegui('center');
correlogram(C, 'AxisLabels', axislabels, 'Sorting', false);