注意:HeatMap和heatmap是不一样的!
使用HeatMap画热图:
clc;
clear;
data = [0,40,0,31,0,0,0,0;
30,0,40,0,2,0,1,0;
0,0,0,0,0,13,0,60;
39,0,31,0,1,0,0,0;
0,30,0,39,0,1,0,0;
1,0,1,0,56,0,12,0;
0,2,0,1,0,56,0,12;
0,0,0,0,12,0,59,0];
xvalues = {'CNC1','CNC2','CNC3','CNC4','CNC5','CNC6','CNC7','CNC8'};
yvalues = {'CNC1','CNC2','CNC3','CNC4','CNC5','CNC6','CNC7','CNC8'};
yvalues=yvalues';
h=HeatMap(data,'Colormap',redbluecmap,'ColumnLabels',yvalues,'RowLabels',xvalues);
h.Annotate = true;%在热图中显示数据值
颜色条可以使用GUI的界面插入colorbar
版权声明:本文为ilovegem原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。