plot_interaction_scores#

Warning

The code reference is a work in progress and may contain inconsistencies.

socialnet.plot.plot_interaction_scores(model_folder: Path | str, fig_vars: Sequence[str], one_neighbour: bool = True, limitsZ: list[float] | None = None, limitsZD: list[float] | None = None, save_folder: Path | None = None, fig_name_suffix: str = '')[source]#

Plots processed interaction scores (attraction, alignment, and repulsion) as a function of kinematic variables of the focal and neighbour animals.

https://gitlab.com/polavieja_lab/socialnet/-/raw/master/examples/interaction_scores_attraction-alignment_vars_fv_nbv_nbx_nby.png

Example output with variables fv nbv nbx nby.#

Parameters:
  • model_folder (Path | str) – Path to the session folder containing the model.

  • fig_vars (Sequence[str]) – Variables to use in the map plot, in the order [row_variable, col_variable, x_variable, y_variable]. These determine the axes and grid of the subplots.

  • one_neighbour (bool, optional) – If True, sets the number of neighbours to 1 when loading the model. If False, uses the default. Default is True.

  • limitsZ (list[float] | None, optional) – Colorbar limits for the attraction-repulsion score plots. If None, limits are determined automatically. Default is None.

  • limitsZD (list[float] | None, optional) – Colorbar limits for the alignment score plots. If None, limits are determined automatically. Default is None.

  • save_folder (Path | None, optional) – Folder to save the resulting figures. If None, saves to model_folder. Default is None.

  • fig_name_suffix (str, optional) – Suffix to append to the saved figure filenames. Default is “”.

Returns:

The function saves the generated figures to disk and does not return anything.

Return type:

None

Notes

This function computes and visualizes the attraction-repulsion and alignment scores derived from the pairwise subnetwork, averaged over possible neighbour and acceleration angles. It produces three figures: attraction, alignment, and a combined attraction-alignment plot, each as a grid of contour plots determined by fig_vars and the model’s plot configuration.