Customizable Heat Maps
********** Updated for 2014b *********
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.
Cite As
Ameya Deoras (2024). Customizable Heat Maps (https://www.mathworks.com/matlabcentral/fileexchange/24253-customizable-heat-maps), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > Colormaps > Red >
- MATLAB > Graphics > Formatting and Annotation > Colormaps > Green >
Tags
Acknowledgements
Inspired: scattertext, An Introduction to Dataset Arrays, Steamgraph, Credit Risk Modeling with MATLAB, Natural Gas Storage Valuation
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
html/
Version | Published | Release Notes | |
---|---|---|---|
1.5.0.1 | Updated license |
|
|
1.5.0.0 | Compatible with 2014b. Some new capabilities like controlling the number of ticks, handling NaN's and setting minimum and maximum color levels |
||
1.4.0.0 | Minor bug fixes |
||
1.3.0.0 | Added copyright notices |
||
1.2.0.0 | Bug fixes and a few more optional parameters added |
||
1.1.0.0 | Major update. New features include:
|
||
1.0.0.0 |