how to plot correlation matrix shown by colored circles?

6 ビュー (過去 30 日間)
Roja Eliza
Roja Eliza 2022 年 5 月 30 日
回答済み: Chunru 2022 年 5 月 30 日
How Can I plot this kind of correlation matrix? this figure was created using R

採用された回答

Chunru
Chunru 2022 年 5 月 30 日
% Generate R
n= 6;
r = magic(n);
r = triu(r);
r(r==0) = NaN
r = 6×6
35 1 6 26 19 24 NaN 32 7 21 23 25 NaN NaN 2 22 27 20 NaN NaN NaN 17 10 15 NaN NaN NaN NaN 14 16 NaN NaN NaN NaN NaN 11
% Plotting
[xx, yy] = meshgrid(1:n, 1:n);
scatter(xx, yy, r*20, 'filled');
set(gca, 'YDir', 'reverse');
colorbar
axis off
% use text to annotate

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by