Connectivity Matrix
Chart overview
A connectivity matrix displays pairwise values - such as functional correlation, structural tract density, or effective connectivity - between all nodes in a network as a colour-coded square matrix.
Key points
- Neuroimaging researchers use it to characterise whole-brain functional networks from fMRI or structural networks from diffusion MRI tractography.
- The matrix reveals modular community structure, hubs, and inter-network coupling that underlie cognition.
Python Tutorial
How to create a connectivity matrix in Python
Use the full tutorial for implementation details, troubleshooting, and chart variations in matplotlib, seaborn, and plotly.
How to Create a Heatmap in PythonExample Visualization

Create This Chart Now
Generate publication-ready connectivity matrixs with AI in seconds. No coding required – just describe your data and let AI do the work.
View example prompt
"Create a brain connectivity matrix from my data. Display pairwise values as a symmetric square heatmap, cluster regions by network, annotate significance with asterisks, use a diverging colormap centred at zero, and format for a journal-quality neuroimaging figure."
How to create this chart in 30 seconds
Upload Data
Drag & drop your Excel or CSV file. Plotivy securely processes it in your browser.
AI Generation
Our AI analyzes your data and generates the Connectivity Matrix code automatically.
Customize & Export
Tweak the design with natural language, then export as high-res PNG, SVG or PDF.
Newsletter
Get one weekly tip for better connectivity matrixs
Join researchers receiving concise Python plotting techniques to improve chart clarity and reduce revision cycles.
Python Code Example
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
np.random.seed(42)
matrix = np.random.rand(15, 15)
matrix = (matrix + matrix.T) / 2
np.fill_diagonal(matrix, 1)
plt.figure(figsize=(8, 7))
sns.heatmap(matrix, cmap='viridis', vmin=0, vmax=1, square=True)
plt.title('Functional Connectivity Matrix', fontsize=14, fontweight='bold', pad=20)
plt.xlabel('Region', fontsize=12)
plt.ylabel('Region', fontsize=12)
plt.tight_layout()
plt.savefig('plotivy-connectivity-matrix.png', dpi=150)
print("Connectivity matrix generated successfully.")
Opens the Analyze page with this code pre-loaded and ready to execute
Console Output
Connectivity matrix generated successfully.
Common Use Cases
- 1Visualising resting-state functional connectivity from fMRI BOLD signals
- 2Displaying structural white-matter connectivity from tractography streamline counts
- 3Comparing connectivity matrices between patient and control groups
- 4Identifying large-scale network modules such as default mode and sensorimotor networks
Pro Tips
Sort rows and columns by network affiliation to reveal modular block structure
Use a diverging colormap (e.g. RdBu_r) centred at zero for correlation data
Mask the diagonal and optionally the lower triangle to reduce redundancy
Annotate statistically significant connections with an asterisk overlay
Long-tail keyword opportunities
High-intent chart variations
Library comparison for this chart
matplotlib
Best when you need full control over axis formatting, annotation placement, and journal-specific styling for connectivity-matrix.
numpy
Useful in specialized workflows that complement core Python plotting libraries for connectivity-matrix analysis tasks.
seaborn
Fastest path to statistically-aware defaults and tidy-data workflows, especially for grouped and distribution-focused connectivity-matrix views.
Scientific Chart Selection Cheat Sheet
Not sure whether to use a Violin Plot, Box Plot, or Ridge Plot? Download our single-page reference mapping the most-used scientific chart types, exactly when to use them, and the core Matplotlib/Seaborn functions.