RSA Visualization

Visualization functions for RSA.

driada.rsa.visual.plot_rdm(rdm, labels=None, title=None, cmap='RdBu_r', figsize=(8, 7), show_values=False, dendrogram_ratio=0.2, cbar_label='Dissimilarity', ax=None)[source]

Plot a representational dissimilarity matrix with optional dendrogram.

Parameters:
  • rdm (np.ndarray) – Square RDM matrix

  • labels (list of str, optional) – Labels for each condition/item

  • title (str, optional) – Plot title

  • cmap (str, default 'RdBu_r') – Colormap for the heatmap

  • figsize (tuple, default (8, 7)) – Figure size if creating new figure

  • show_values (bool, default False) – Whether to show numerical values in cells

  • dendrogram_ratio (float, default 0.2) – Proportion of figure height for dendrogram (0 to disable)

  • cbar_label (str, default 'Dissimilarity') – Label for colorbar

  • ax (matplotlib.Axes, optional) – Existing axes to plot on (disables dendrogram)

Returns:

fig – The figure object

Return type:

matplotlib.Figure

driada.rsa.visual.plot_rdm_comparison(rdms, labels=None, titles=None, figsize=None, cmap='RdBu_r')[source]

Plot multiple RDMs side by side for comparison.

Parameters:
  • rdms (list of np.ndarray) – List of RDM matrices to compare

  • labels (list of str, optional) – Labels for conditions/items (same for all RDMs)

  • titles (list of str, optional) – Title for each RDM

  • figsize (tuple, optional) – Figure size (default based on number of RDMs)

  • cmap (str, default 'RdBu_r') – Colormap for the heatmaps

Returns:

fig – The figure object

Return type:

matplotlib.Figure

Visualization functions for representational dissimilarity matrices and RSA results.