matlab - 在 Matlab 中创建相关图

标签 matlab graphics plot correlation

我正在尝试模拟此图:enter image description here

如果我有一个相关矩阵,我该如何创建这样的输出?

最佳答案

如果您有一个 n x n 相关矩阵 M 和一个长度为 n 的向量 L 包含标签对于每个 bin,您可以使用如下内容:

imagesc(M); % plot the matrix
set(gca, 'XTick', 1:n); % center x-axis ticks on bins
set(gca, 'YTick', 1:n); % center y-axis ticks on bins
set(gca, 'XTickLabel', L); % set x-axis labels
set(gca, 'YTickLabel', L); % set y-axis labels
title('Your Title Here', 'FontSize', 14); % set title
colormap('jet'); % set the colorscheme
colorbar on; % enable colorbar

旋转 x 轴标签并不简单,但 MATLAB 中央文件交换包含 some solutions .

关于matlab - 在 Matlab 中创建相关图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10388940/

相关文章:

matlab - reshape 以垂直平铺列 block 低于先前的列

pdf - "Publish"到 pdf

matlab - MATLAB 中冒号运算的组合

java - 用一条线连接两个圆

r - 如何将 ccf () 图中值高于 0.07 或低于 -0.07 的每一列涂成绿色?

matlab - 为什么 strcat(mystring) 与 mystring 不同?

java - Android - 使用 LinearLayout 制作 ScrollView

c++ - 设置 sfml

python - 如何正确绘制超大刻度线?

r - 根据增加或减少值更改点的颜色