File Exchange

image thumbnail

Heat Maps with Text

version 1.1.0.1 (46.5 KB) by

Heat maps with numeric values overlayed

8 Downloads

Updated

View License

Editor's Note: This was a File Exchange Pick of the Week

A number of people have asked me whether MATLAB can add text to heatmaps to show the exact values. This is very easy to do, however, making a the text robust to resizing, zooming and other operations is a little trickier.
This example shows how to add text to the heatmap and also includes an M-file that shows how to handle zooming and resizing.

Comments and Ratings (5)

Great function. Line 88 could be changed to something like:
                 textHandles(j,i) = text(j,i,sprintf(['%.' num2str(precision) 'f'],data(i,j)),...

Then the numeric precision is counting from the decimal point

Tristan

Is there a way to make this function robust to a change of figure units to centimeters?

Matlab2010

PS. to be able to use XtickLabel etc to name the axis after making this image, type "axis on"

Matlab2010

excellent

Dimitri Shvorob

Useful, instructive, and nicely presented.

Updates

1.1.0.1

Updated license

1.1

Added BSD license

MATLAB Release
MATLAB 7.4 (R2007a)
Acknowledgements

Inspired: scattertext

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video