Clustered Heatmap Explained: Hierarchical Clustering, Dendrograms and Interpretation
Updated November 7, 2026 · StatFAS Guides · Reading time about 8 minutes
Researchers meet the clustered heatmap in papers on genomics, medicine and biology, yet many readers struggle to read the clustered heatmap correctly. This guide explains the clustered heatmap, shows when the clustered heatmap helps, lists the points that matter for interpretation, and gives working routes to build the clustered heatmap in SPSS, R, Python and online.
- What is a clustered heatmap?
- When should you use a clustered heatmap?
- Why use a clustered heatmap?
- How to interpret a clustered heatmap
- Common mistakes
- How to make a clustered heatmap in SPSS, R and Python
- The easy way: make a clustered heatmap on statfas.com
- How to report the results in APA 7
- Frequently asked questions
What is a clustered heatmap?
A clustered heatmap shows a table of numbers as a grid of coloured cells. Rows are features (genes, proteins, metabolites, species) and columns are samples. The colour of each cell encodes the value, often a z-score.
Hierarchical clustering then reorders rows and columns so that similar ones sit next to each other, and tree diagrams (dendrograms) display the grouping. Blocks of colour reveal sets of features that behave together and samples that resemble each other.
When should you use a clustered heatmap?
- Exploring expression, abundance or ecological matrices with many features and many samples.
- Checking whether samples from the same experimental group cluster together, as a quality control for replicates and batches.
- Presenting co-expressed gene modules, metabolite signatures or marker panels.
Why use a clustered heatmap?
- A clustered heatmap turns a large table into a pattern that the eye can read at a glance.
- The clustered heatmap displays unsupervised structure, so unexpected sample groupings, outliers and batch effects become visible.
- Annotation bars for groups connect the pattern to the experimental design.
How to interpret a clustered heatmap
These are the key points for reading the clustered heatmap correctly:
- Read colours relative to the scale. With row z-scores, red means higher than that row’s average and blue means lower; the colours do not compare different rows with each other.
- Judge the dendrograms by the height at which branches join: early joins at low height mean similar profiles, late joins at large height mean dissimilar profiles.
- Report the distance measure, the linkage method and the scaling, because each choice changes the clustering.
- The cophenetic correlation measures how faithfully a dendrogram preserves the original distances; higher values indicate a more faithful tree.
- Check whether samples cluster by experimental group or by technical factors such as batch, date or operator.
- Treat clusters as hypotheses. Clustering always produces a tree, even for random data, so confirm patterns with tests such as ANOVA and with independent data.
Common mistakes with the clustered heatmap
- Clustering without scaling, so that high-abundance features dominate the picture.
- Choosing the number of features by looking at which choice gives the prettiest picture.
- Reading the vertical order of rows as a ranking; only the branching structure carries meaning.
- Presenting clusters as proof of biological subtypes without validation.
Upload or paste data and get the clustered heatmap, the statistics and an APA 7 write-up in seconds.
Open the free Clustered Heatmap Maker
How to make a clustered heatmap in SPSS, R and Python
Full scripts are in the step-by-step Clustered Heatmap Tutorial: pheatmap in R, seaborn in Python, SPSS and Online. The key commands are shown here.
SPSS
SPSS performs hierarchical cluster analysis and draws a dendrogram, but does not draw colour-coded heatmaps. Use SPSS for the clustering and tests, and a dedicated tool for the figure.
CLUSTER ZGene_01 TO ZGene_60 /METHOD BAVERAGE /MEASURE=SEUCLID /PLOT DENDROGRAM.R
The pheatmap package clusters, scales and draws the clustered heatmap in one call; base R functions give the cophenetic correlation and the ANOVA tests.
pheatmap(top, scale = "row", clustering_method = "average")Python
The seaborn clustermap function draws the clustered heatmap; SciPy supplies the cophenetic correlation and ANOVA.
sns.clustermap(top, z_score=0, method="average", cmap="RdBu_r")The easy way: make a clustered heatmap on statfas.com
The free Clustered Heatmap Maker on statfas.com runs the required statistics, draws a publication-ready figure and writes the interpretation in APA 7 style. No installation and no coding are needed:
- Open the tool. Go to the StatFAS Clustered Heatmap Maker.
- Add data. Click Load example data to see the layout, then paste or upload a matrix with features in rows and samples in columns.
- Choose settings. Set the number of features, how to select them, scaling, distance, linkage, whether to cluster rows and columns, and the colour scale.
- Read the results. The tool draws the clustered heatmap with dendrograms and group bars, calculates cophenetic correlations, sample-cluster purity and one-way ANOVA with FDR for each feature.
- Download. Download the PNG or SVG, or a Word file with the figure, the tables and the APA 7 interpretation.
How to report the results in APA 7
An example results paragraph for the clustered heatmap:
Adapt the numbers to the data, state thresholds before the analysis, and cite the software used.
Frequently asked questions
What does a clustered heatmap show?
A clustered heatmap shows a data matrix as colours, with rows and columns reordered by hierarchical clustering so that similar features and similar samples appear together.
Should data be scaled before clustering?
Usually yes. Row z-scores place all features on a common scale, so that clustering reflects patterns rather than absolute abundance.
Which linkage method is best?
Average linkage is a balanced default, complete linkage gives compact clusters. Report the choice and check that conclusions do not depend on the method.
What is the cophenetic correlation?
The cophenetic correlation is the correlation between the original pairwise distances and the distances implied by the dendrogram; higher values mean the tree represents the data more faithfully.
Related guides
How to cite this page: StatFAS. (2026, November 7). Clustered Heatmap Explained: Hierarchical Clustering, Dendrograms and Interpretation. https://statfas.com/blogs/clustered-heatmap-explained-hierarchical-clustering