Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
697 views
in Technique[技术] by (71.8m points)

heatmap - MATLAB heat map

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, ...)

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.

Thanks so much.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...