special heatmap

Plot heatmaps of various shapes, triangular heatmaps, and add Mantel test links, dendrograms and significance labels.

https://github.com/slandarer/MATLAB-special-heatmap

You are now following this Submission

Demos
SHeatmap is a highly customizable heatmap plotting tool. It supports approximately 30 Format types (e.g., square, rounded rectangle, pie, teardrop, etc.) and various triangular heatmaps (upper, lower, strictly upper/lower). It includes built-in support for cluster blocks and dendrograms. All graphical elements are exposed as editable objects, including cell objects, box, frame, grid, extGrid, rowTick, colTick, rowLabel, colLabel, rowGroupLabel, and colGroupLabel. Companion legend (SLegend) and colorbar (SColorbar) objects can be added in any number and can be rotated. Dendrograms, heatmaps, and cluster blocks can not only be rotated but also mapped to polar coordinates to form annular heatmaps.
1 Basic use (基础使用)
1.1 Draw positive heatmap (非负矩阵)
Data = rand(15, 15);
SHM = SHeatmap(Data, 'Format', 'sq');
SHM.draw();
1.2 Contains negative numbers (绘制有负数热图)
Data = rand(15, 15) - .5;
SHM = SHeatmap(Data, 'Format','sq');
SHM.draw();
1.6 绘制有文本热图(Draw heat map with texts)
使用 setText() 方法显示文字:
Use the setText() method to display text:
Data = rand(12,12)-.5;
Data([4,5,13]) = nan;
SHM = SHeatmap(Data, 'Format','sq');
SHM.draw();
SHM.setText();
1.8 Draw heatmap with labels by RowName and ColName (绘制带标签热图, 使用 SHeatmap 的行列标签功能)
Data = rand(12, 12);
SHM = SHeatmap(Data, 'Format','sq');
SHM.ColName = {'X-1','X-2','X-3','X-4','X-5','X-6','X-7','X-8','X-9','X-10','X-11','X-12'};
SHM.RowName = {'Y-1','Y-2','Y-3','Y-4','Y-5','Y-6','Y-7','Y-8','Y-9','Y-10','Y-11','Y-12'};
SHM.draw();
SHM.setFrame()
2 Various Format of heatmaps (各类型热图绘制)
% 'sq' : square (default) : 方形 (默认)
% 'sqfull' : square (full-size) : 方形 (满格)
% 'shade' : Square (neg-values shaded): 方形 (负数部分阴影填充)
% 'rrect' : rounded rectangle : 圆角矩形
% 'c2rect' : circle to rectangle : 圆形到矩形过度
% 'pie' : pie chart : 饼图
% 'donut' : donut chart : 环形饼图 (甜甜圈图)
% 'circ' : circle : 圆形
% 'bcirc' : circle with box : 有边框的圆形
% 'oval' : oval : 椭圆形
% 'hex' : hexagon :六边形
% 'star' : star : 五角星
% 'moon' : moon : 月亮
% 'arrow' : arrow : 箭头
% 'teardrop' : teardrop : 水滴状
% 'bar' : bar graph : 柱状图
% 'barh' : Horizontal bar graph : 水平柱状图
% 'trill'(tril) : lower left triangle : 下三角
% 'triur'(triu) : upper right triangle : 上三角
% 'trilr' : lower right triangle : 右下三角
% 'triul' : upper left triangle : 左上三角
% 'asq' : auto-size square :自带调整大小的方形
% 'acirc' : auto-size circular :自带调整大小的圆形
% 'arrect' : auto-size rounded rect : 自带调整大小的圆角矩形
% 'bubble' : bubble : 气泡图
% 'txt'(text) : colored text : 带颜色的文本
% '3d' : 3D bar : 三维柱状图
% 'cust' : custom shape : 自定义形状
% 'acust' : auto-size custom shape : 自带调整大小的自定义形状
Additional examples are available in the README file,
the demo files, and the demos folder.

Cite As

Zhaoxu Liu / slandarer (2026). special heatmap (https://github.com/slandarer/MATLAB-special-heatmap), GitHub. Retrieved .

Zhaoxu Liu / slandarer (2025). special heatmap (https://www.mathworks.com/matlabcentral/fileexchange/125520-special-heatmap), MATLAB Central File Exchange.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes Action
5.0.2

Update description.

5.0.1

Change cover.

5.0.0

The heatmap rendering is now three times faster, with additional support for 45‑degree rotation and annular visualization modes.

4.0.2

Change images

4.0.1

Revise the summary

4.0.0

Supporting Heatmap with Mantel test links

3.1.3

Default Branch

3.1.2

See release notes for this release on GitHub: https://github.com/slandarer/matlab-special-heatmap/releases/tag/v3.1.2

3.1.0

See release notes for this release on GitHub: https://github.com/slandarer/matlab-special-heatmap/releases/tag/v3.1.0

3.0.4

Comment update.

3.0.3

Comment Update

3.0.2

Fixed a bug where the 'Color' property of class 'matlab.graphics.layout.TiledChartLayout' was not recognized.

3.0.1

Improve the readme file

3.0.0

+ 更多形状(More shapes)
+ 使用不同colormap(Draw heat maps with two colormaps)
+ 显示显著性(Displaying significance)

2.1.1

support setting text format

2.1.0

More Description

2.0.0

可设置为上三角或下三角(Set to upper triangle or lower triangle)
增添较多示例(Give more demos)
+ 设置为上三角或下三角(Set to upper triangle or lower triangle)
+ 合并两个三角热图(Merge two triangle heat maps)
+ 带树状图热图(Heatmap with dendrogram)
+ 带分组热图(Grouping heat map)
+ ... ...

1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.