I'm trying to emulate this graph:
如果我有一个相关矩阵,如何创建这样的输出?
如果你有一个n x n
相关矩阵M
,和一个向量L
长度n
包含每个垃圾箱的标签,您可以使用如下所示的内容:
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 Central File Exchange 包含一些解决方案 http://www.mathworks.com/matlabcentral/fileexchange/8722.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)