MATLAB热图 [英] MATLAB heat map
问题描述
我正在尝试使用MATLAB创建热图,但是MATLAB程序中的默认功能对我没有任何意义.
I am trying to create a heat map using MATLAB, but the default function in MATLAB program doesn't any sense to me.
http://www.mathworks.com/help/bioinfo/ref/heatmap.html
有没有人可以首先帮助我进行标签制作,以便在此之后我自己可以阅读其他功能?还是有其他任何程序将具有更加用户友好的界面?
Is there anyone who can help me with labeling first, so that I can read through the other function myself after that? Or is there any other program which will have a more user-friendly interface?
HeatMap(Data, ...'RowLabels', RowLabelsValue, ...)
我有一个81*2
矩阵的数据集,我的标签是x轴为81*1
单元格,y轴为1*2
单元格.现在,我可以成功导入excel数据并使用热图绘制数据了,但是我很难在HeatMap函数中填写变量.
I have a data set of a 81*2
matrix and my label is a 81*1
cell for x-axis and 1*2
for y-axis. Now I can successfully import the excel data and plot the data using a heat map, but I have a hard time fill in the variable in the HeatMap function.
非常感谢.
推荐答案
HeatMap实际上不是标准功能,它来自生物信息学工具箱.绘制热图的简单方法可能是:
HeatMap isn't actually standard function for this, it comes from the Bioinformatics Toolbox. The simple way of drawing a heatmap might be like:
A = 1:50; % matrix to draw
colormap('hot'); % set colormap
imagesc(A); % draw image and scale colormap to values range
colorbar; % show color scale
如@natan所建议,您可能要先构建矩阵,然后使用image
或imagesc
进行绘制.您还可能希望在我的博客上看到一篇文章,该文章显示一些颜色集比可访问性要好其他,例如用于灰度或色觉不足的印刷.
As @natan suggested, you might want to build your matrix first and then draw using image
or imagesc
. Also you migt want to see article on my blog which shows that some color sets are better for accessibility than others, e.g. for printing in grayscale or in color vision deficiency.
这篇关于MATLAB热图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!