Code covered by the BSD License  

Highlights from
Customizable Heat Maps

5.0

5.0 | 12 ratings Rate this file 256 Downloads (last 30 days) File Size: 424 KB File ID: #24253
image thumbnail

Customizable Heat Maps

by Ameya Deoras

 

24 May 2009 (Updated 21 Dec 2011)

Visualize data as a heatmap with many customizable options.

| Watch this File

File Information
Description

HEATMAP displays a matrix as an image whose color intensities reflect the magnitude of its values. In addition, it enables you to specify the following properties:

* X- and Y-axes tick labels:
Display the row/column indices or any other numeric or text labels. X-axis tick labels can even be rotated.

* Text labels:
Overlay the heatmap image with formatted text labels. The text labels can be derived from the original numeric matrix or a different matrix or cell array for displaying another dimension of data. You can control the font size and font color of the labels. The labels update automatically with zooming, panning or resizing the figure.

* Custom color maps:
Use MATLAB's default color maps or specify your own. The function provides two additional color maps - "money" (shown in the example image) and "red" (a color map of red color intensities). Specify Linear or Logarithmic color maps and the number of color levels. You can even use different color maps for different heat maps within a figure.

* Other configurable parameters such as grid lines, color bars.

For detailed examples, see the associated document heatmap_examples.m

NOTE: If using rotated tick labels, HEATMAP will resize the axes to make room for the tick labels. When overwriting existing heatmap plots with a new heatmap, use CLF to first clear the figure. See heatmap_examples for an illustration.

Acknowledgements

Heat Maps With Text inspired this file.

This file inspired An Introduction To Dataset Arrays and Credit Risk Modeling With Matlab.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
color map(2), heat map(5), heatmap(3), visualization
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
01 May 2013 Maxim

Wow! Where I've been all this time! Thanks a lot.

29 Apr 2013 Jonathan W

Excellent script. I have a question. Is there a way to color only certain values? Say, between 0 and 0.001 have one color, between 0.001 and 0.01 a different color, between 0.01 and 0.05 a different color, and everything else appear as white/blank? Thanks for your help.

20 Apr 2013 Yilong Jia  
02 Mar 2013 Tung Le

Thanks for the code. It's very helpful.

I have a question. I want to plot two different heat maps but using the same color range so that one can compare them qualitatively. Is there anyway to do that with this code?
Thank you.

10 Jan 2013 Franck Dernoncourt

Awesome!
Just one small detail: if the matrix has a dimension < 7 and that we don't set 'ShowAllTicks', true, it might screw the labels due to (heatmap.m)

if p.ShowAllTicks
xtick = 1:length(xlab);
else
xtick = get(p.hAxes, 'XTick');

> xtick = get(p.hAxes, 'XTick'); can return a larger array than xlab, thereby exploding at xlab(xtick).

Same for y I guess.

02 Jan 2013 Kevin

A very nice application of heat maps that can be used to quickly integrate heat maps into a project. Great work and thanks for sharing.

17 Jul 2012 Paul  
11 Jul 2012 Jessica Lam  
25 May 2012 Shaohan Hu  
29 Feb 2012 Sergio

Very useful tool to give the wow factor for presentations of data. Enables the creation of heat maps very quickly.

25 Feb 2012 Bayes Zhang  
29 Dec 2011 Syed Abbas

Great! Very helpful

15 Feb 2010 Gareth Thomas

Very nice:) I found it very useful

Updates
21 Dec 2011

Major update. New features include:
* Text labels correctly update when figure is zoomed, panned or resized
* X tick labels can be rotated
* Show all or a subset of tick labels for large matrices

Contact us