How to plot correlation coefficient matrix plot?
382 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to plot a correlation coefficient matrix plot and I want to show the values at each individual box as shown in the picture. I have my my calculated correlation coeff values.
0 Kommentare
Antworten (1)
Adam Danz
am 29 Jun. 2022
Bearbeitet: Adam Danz
am 29 Jun. 2022
Assuming you already have the correlation matrix, use heatmap. The upper triangle can be filled with NaNs.
S = load('Data_Canada');
r = corr(S.Data)
% Replace upper triangle with NaNs
isupper = logical(triu(ones(size(r)),1));
r(isupper) = NaN
% Plot results
h = heatmap(r,'MissingDataColor','w');
labels = ["wt","hp","xy","ad","tt"];
h.XDisplayLabels = labels;
h.YDisplayLabels = labels;
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!