Heatmap
Visualize data matrices and relationships with color intensity
Use me when you have a grid of numbers and want to paint them with colors. Hot colors for high values, cool colors for low values - like a thermal camera for your data. I make patterns jump out instantly. Perfect for correlation matrices (which variables are friends?), time patterns (what hour/day is busiest?), or any table that needs visual punch.
A heatmap is a data visualization technique that uses color to represent values in a matrix format. Each cell in the grid is colored according to its value, with color intensity indicating magnitude. Heatmaps excel at revealing patterns, correlations, and anomalies in large datasets at a glance.
Best used for:
- Visualizing correlation matrices
- Showing patterns in time series data (hour × day)
- Comparing values across two categorical dimensions
- Identifying hotspots and clusters in data
- Displaying confusion matrices
- Analyzing geographic or spatial data density
Common Use Cases
Data Analysis & Statistics
- Correlation matrices between variables
- Covariance matrices
- Cross-tabulation of categorical variables
- Distance matrices for clustering
- Feature importance across conditions
Business & Operations
- Sales by product × region
- Website traffic by hour × day of week
- Customer activity patterns
- Inventory levels across locations and time
- Performance metrics by department and quarter
Scientific & Research
- Gene expression data (genes × samples)
- Experimental results across conditions
- Temperature or climate data (location × time)
- Survey responses (questions × respondents)
- Spectral data analysis
Options
X-Axis
Required - Select the column for horizontal axis categories.
Values from this column will form the columns of the heatmap grid.
Y-Axis
Required - Select the column for vertical axis categories.
Values from this column will form the rows of the heatmap grid.
Cell Value
Required - Define what value to display in each cell.
This determines the color intensity of each cell in the heatmap.
Column
Select the numerical column containing the values to visualize.
Aggregation Function
Choose how to aggregate values when multiple data points fall into the same cell:
Options:
- Sum - Total of all values
- Count - Number of occurrences (useful for frequency heatmaps)
- Mean - Average value (most common for heatmaps)
- Median - Middle value
- Min - Minimum value
- Max - Maximum value
- Std - Standard deviation
- Var - Variance
- First - First value encountered
- Last - Last value encountered
Settings
Hide Empty Values
Optional - Exclude cells with no data. Leaves cells blank (or grey) where no data exists, rather than filling with zero
Show Trendline
Optional - Overlay a trend line (if applicable)
May not be meaningful for all heatmaps, primarily useful for sequential data.
Use Logarithmic Scale For X Axis
Optional - Apply log scale to X-axis.
Useful when X-axis values span orders of magnitude.
Use Logarithmic Scale For Y Axis
Optional - Apply log scale to Y-axis.
Useful when Y-axis values span orders of magnitude.
Show Values on Cells
Optional - Display the numerical value in each cell.
Annotates each cell with its value, making exact values easier to read.
Value Format
Optional - Number format for cell annotations.
Options:
- No Decimals (.0f)
- 1 Decimal (.1f)
- 2 Decimals (.2f) - Default
- 3 Decimals (.3f)
Aspect Ratio
Optional - Shape of the cells.
Options:
- Square Tiles (equal) - Default, cells are square
- Fill Area (auto) - Cells stretch to fill available space
Show Hover on Gaps
Optional - Show tooltips even on empty cells.
When disabled, hovering over empty cells shows nothing. When enabled, shows that the cell is empty.
Tips for Effective Heatmaps
-
Choose Appropriate Aggregation:
- Use Mean for averaged metrics
- Use Count for frequency patterns
- Use Sum for totals
- Use Max or Min to find extremes
-
Color Scale Selection:
- Sequential scales (light to dark) for quantitative data
- Diverging scales (red-white-blue) for data with meaningful midpoint
- Consider colorblind-friendly palettes
-
Order Your Data:
- Sort rows/columns to reveal patterns
- Group similar categories together
- Use clustering algorithms for optimal ordering
-
Limit Matrix Size:
- Too many cells make patterns hard to see
- Consider aggregating categories
- Use filtering for large datasets
- Aim for 20×20 or smaller for readability
-
Annotate Strategically:
- Show values only when needed
- Use appropriate decimal precision
- Consider showing values only for notable cells
-
Handle Missing Data:
- Use "Hide Empty Values" to distinguish missing from zero
- Consider using a distinct color for missing data
- Document what empty cells mean
Understanding Heatmap Patterns
Diagonal Pattern
Strong diagonal pattern in a correlation matrix indicates high correlation between variables.
Cluster Pattern
Blocks of similar colors indicate clusters or groups with similar characteristics.
Temporal Pattern
In time-based heatmaps, horizontal or vertical bands show periodic patterns.
Example Scenarios
Correlation Matrix
Shows relationships between all pairs of variables.
Sales by Region and Product
Identifies which products perform best in which regions.
Website Traffic by Time
Reveals when users are most active (hour of day × day of week).
Performance Across Conditions
Compares metrics across different experimental conditions.
Troubleshooting
Issue: Colors are all similar, can't see patterns
- Solution: Data range might be too narrow or too wide. Consider using log scale or filtering outliers. Check if aggregation is appropriate.
Issue: Too many cells to read
- Solution: Reduce number of categories by aggregating or filtering. Consider using faceting to split into multiple smaller heatmaps.
Issue: Missing or empty cells
- Solution: Enable "Hide Empty Values" to distinguish missing data from zeros. Check if data exists for all combinations of X and Y values.
Issue: Values are not visible on cells
- Solution: Enable "Show Values on Cells". Adjust text size in styling options. Consider if there are too many cells to show values.
Issue: Cells are rectangular instead of square
- Solution: Set Aspect Ratio to "Square Tiles (equal)" for uniform cell shapes.
Issue: Can't distinguish between similar values
- Solution: Adjust color scale range or use a diverging color scheme. Consider showing values to supplement color.
Issue: Outliers dominate the color scale
- Solution: Use log scale or filter/cap extreme values. Consider showing outliers separately.