Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB heat map

Tags:

matlab

heatmap

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.

like image 565
user1739858 Avatar asked Oct 12 '12 02:10

user1739858


People also ask

How do I make a heat map in Matlab?

Create a matrix of data. Then create a heatmap of the matrix values. Use custom labels along the x-axis and y-axis by specifying the first two input arguments as the labels you want. Specify the title and axis labels by setting properties of the HeatmapChart object.

What is heat map in AI?

A heat map is a two-dimensional representation of data in which values are represented by colors. A simple heat map provides an immediate visual summary of information. More elaborate heat maps allow the viewer to understand complex data sets.

What is heat map function?

Heatmaps are used in various forms of analytics but are most commonly used to show user behavior on specific webpages or webpage templates. Heatmaps can be used to show where users have clicked on a page, how far they have scrolled down a page or used to display the results of eye-tracking tests.


2 Answers

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.

like image 80
Paweł Bulwan Avatar answered Oct 03 '22 19:10

Paweł Bulwan


I'm not sure what you're actually trying to accomplish, but I think you might want to use colormap{}. If you're trying to create a classic "heatmap", then colormap is the function you want. Basically, if you've got x,y position, and a Z value that you want to represent as a color, this is the trick for you.

like image 38
Marc Avatar answered Oct 03 '22 17:10

Marc