spectralbrain.viz.graphics#
Publication-quality graphics and statistical visualisations.
Foundation module for all SpectralBrain visualisations: palettes,
colormaps, figure factory, multi-format export (always PNG @600 dpi),
a custom distplot, and figure functions directly linked to
spectralbrain.statistics.analysis.
Every plot_* returns (fig, ax) for customisation before saving.
Every function accepts an optional save parameter for auto-export.
Functions
|
Custom distribution plot — histogram + KDE + rug. |
|
Create a publication-ready figure. |
|
Connectome heatmap — visualises |
|
Cohen's d distribution — visualises |
|
2D scatter — visualises PCA/MDS/UMAP from analysis.py. |
|
Paired violin L vs R — visualises |
|
P-value diagnostic histogram — for |
|
RDM heatmap — visualises |
|
ROC curve with AUC — visualises |
|
Volcano plot: effect size vs −log₁₀(p). |
|
Save figure — always PNG, plus optional PDF/SVG/JPG. |
|
Apply SpectralBrain matplotlib style globally. |
- spectralbrain.viz.graphics.distplot(data, *, labels=None, colors=None, hist=True, kde=True, rug=False, bins='auto', alpha_hist=0.35, alpha_kde=0.9, fill_kde=True, alpha_fill=0.15, vertical_lines=None, xlabel='', ylabel='Density', title='', ax=None, save=None, **save_kw)[source]#
Custom distribution plot — histogram + KDE + rug.
Drop-in replacement for seaborn’s deprecated
distplotwith SpectralBrain styling and multi-group support.
- spectralbrain.viz.graphics.figure(preset=None, *, width=None, height=None, nrows=1, ncols=1, unit='mm', **subplot_kw)[source]#
Create a publication-ready figure.
- spectralbrain.viz.graphics.plot_connectome_matrix(matrix, *, labels=None, network_boundaries=None, cmap='sb_spectral', title='Geometric Connectome', ax=None, save=None)[source]#
Connectome heatmap — visualises
build_geometric_connectome().
- spectralbrain.viz.graphics.plot_effect_size_distribution(effect_sizes, *, threshold=0.5, title='Vertex-wise effect sizes', ax=None, save=None)[source]#
Cohen’s d distribution — visualises
cohens_d_map().
- spectralbrain.viz.graphics.plot_embedding(coords, *, labels=None, group_names=None, colors=None, method_name='Embedding', alpha=0.7, size=15, ax=None, save=None)[source]#
2D scatter — visualises PCA/MDS/UMAP from analysis.py.
- spectralbrain.viz.graphics.plot_laterality(left, right, *, labels=None, group_names=None, title='Lateralisation', ax=None, save=None)[source]#
Paired violin L vs R — visualises
asymmetry_test().
- spectralbrain.viz.graphics.plot_pvalue_histogram(p_values, *, alpha=0.05, title='P-value distribution', ax=None, save=None)[source]#
P-value diagnostic histogram — for
vertexwise_ttest().
- spectralbrain.viz.graphics.plot_rdm(rdm_matrix, *, labels=None, cmap='sb_sequential', title='Representational Dissimilarity Matrix', ax=None, save=None)[source]#
RDM heatmap — visualises
rdm().
- spectralbrain.viz.graphics.plot_roc_curve(y_true, y_scores, *, label=None, color=None, ax=None, save=None)[source]#
ROC curve with AUC — visualises
classify().
- spectralbrain.viz.graphics.plot_volcano(effect_sizes, p_values, *, alpha=0.05, effect_threshold=0.0, xlabel="Effect size (Cohen's d)", title='Volcano plot', ax=None, save=None)[source]#
Volcano plot: effect size vs −log₁₀(p).
Visualises
vertexwise_ttest().