CorrPlot (Correlation Plot with Dendrogram) Examples
This page demonstrates the interactive CorrPlot chart type in JSPlots.
Hierarchical clustering: Dendrogram shows similarity grouping of variables
Dual correlation display: Pearson (upper right) and Spearman (lower left) correlations in one matrix
Julia-computed correlations: Use compute_correlations() convenience function
Flexible clustering: Use cluster_from_correlation() with different linkage methods
Automatic ordering: Variables reordered by clustering for clearer patterns
Example 1: Financial Metrics Correlation Analysis
Analyze correlations between various financial metrics for companies.
This example demonstrates:
10 financial metrics tracked for 100 companies
Computing both Pearson and Spearman correlations in Julia
Hierarchical clustering with Ward linkage
Compare Pearson vs Spearman correlations to detect non-linear relationships
Variables automatically reordered by clustering to reveal patterns
Financial Metrics Correlation Analysis
This correlation plot shows relationships between financial metrics. The dendrogram groups similar metrics based on correlation patterns. Variables are automatically reordered by clustering to reveal correlation blocks. Top-right triangle shows Pearson correlations (linear relationships), while bottom-left shows Spearman correlations (rank-based, captures non-linear monotonic relationships).
Example 2: Sales Performance Metrics
Examine correlations between sales KPIs using average linkage clustering.
Features:
Multiple sales metrics: revenue, units, conversion rate, customer satisfaction, etc.
Average linkage clustering (different from Ward linkage in Example 1)
Identify which metrics move together
Detect leading indicators through correlation patterns
Explore how different sales and operational metrics relate to each other. This example uses average linkage clustering (compare to Ward linkage in Example 1). The dendrogram reveals which metrics cluster together. For example, you might see that customer satisfaction groups with response time, while revenue metrics cluster separately.
Example 3: Scientific Measurements - Single Linkage Clustering
This example demonstrates single linkage clustering (nearest neighbor).
Features:
Physical and chemical measurements from laboratory experiments
Demonstrates 'single' linkage clustering
Single linkage tends to create elongated clusters
Compare this dendrogram shape to Ward (Example 1) and average (Example 2) linkage
This correlation plot reveals clusters of related physical, thermal, chemical, and spectroscopic properties. Single linkage clustering creates elongated clusters by merging based on nearest neighbors. Notice how the dendrogram groups density-related properties together, thermal properties in another cluster, and spectroscopic measurements in a third cluster. The dual correlation display (Pearson vs Spearman) helps identify non-linear relationships.
Example 4: Healthcare Patient Metrics - Complete Linkage
Analyze correlations between patient health indicators using complete linkage clustering.
This example includes:
Vital signs, lab results, and outcome metrics
Complete linkage clustering (farthest neighbor)
Identify risk factor correlations
Compare linear (Pearson) vs monotonic (Spearman) relationships
Patient Health Metrics Correlation (Complete Linkage)
This correlation analysis helps identify relationships between vital signs, lab results, and cardiovascular risk. Complete linkage clustering (farthest neighbor) tends to create compact, well-separated clusters. The dendrogram reveals natural groupings: blood pressure metrics cluster together, lipid panel values form another group, and glucose-related metrics cluster separately. Compare Pearson (upper right) vs Spearman (lower left) correlations to see if relationships are linear or non-linear.
Example 5: Advanced CorrPlot - Economic Indicators Across Regions
Compare economic indicator correlations across different geographic regions:
Three regional scenarios: North America, Europe, Asia-Pacific
Variable selection: Choose which economic indicators to analyze
Compare patterns: See how indicator relationships vary by region
Useful for international portfolio analysis and macroeconomic research
Insights to explore:
How does GDP correlate with unemployment differently across regions?
Are inflation-interest rate relationships similar globally?
Which indicators cluster together in each region?
Economic Indicators - Regional Comparison
Compare how economic indicators correlate across North America, Europe, and Asia-Pacific. Switch between regions to see different correlation patterns. Select specific indicators to focus your analysis. Notice how GDP Growth correlates differently with other indicators in each region, reflecting different economic structures and policies.
Example 6: Advanced CorrPlot - Climate Variables by Season
Analyze how climate variable correlations change across seasons:
Four seasonal scenarios: Spring, Summer, Fall, Winter
Interactive variable selection: Focus on specific climate factors
Seasonal patterns: See how temperature-humidity relationships vary
Demonstrates that correlation structure can change with context (season)
Key observations:
Temperature-humidity correlations differ by season
Precipitation patterns cluster differently in summer vs winter
Solar radiation shows different relationships across seasons
Climate Variable Correlations - Seasonal Analysis
Explore how climate variable correlations change across seasons. Switch between Spring, Summer, Fall, and Winter to see seasonal patterns. Notice how Temperature-Humidity correlations flip between seasons (negative in Spring/Fall, positive in Summer/Winter). Use variable selection to focus on specific climate factors. Try manual ordering to group related variables by type (temperature-related, precipitation-related, etc.).
Summary
The CorrPlot chart type provides:
Hierarchical clustering: Dendrogram shows which variables are most similar based on correlation patterns
Dual correlation display:
Top-right triangle: Pearson correlation (measures linear relationships)
Bottom-left triangle: Spearman correlation (measures monotonic relationships, robust to outliers)
Julia-computed correlations: Use compute_correlations() for both Pearson and Spearman
Flexible clustering: Use cluster_from_correlation() with different linkage methods (:ward, :average, :single, :complete)
Automatic ordering: Variables reordered by clustering results for clearer visualization of correlation blocks