spapros.pl.cluster_similarity

spapros.pl.cluster_similarity(selections_info, data=None, groupby=None, interpolate=True, figsize=(8, 5), fontsize=18, show=True, save=None)

Plot cluster similarity as NMI over number of clusters

Parameters:
  • selections_info (DataFrame) –

    Information on selections for plotting. The dataframe includes:

    • selection ids or alternative names as index

    • column: path (mandatory if data=None): path to results csv of each selection (which contains number of clusters (as index) and one column containing the data to plot)

    • optional columns:

      • color: matplotlib color

      • linewidth: matplotlib linewidth

      • linestyle: matplotlib linestyle

      • <groupby>: some annotation that can be used to group the legend

    Note that the legend order will follow the row order in selections_info.

  • data (Optional[Dict[str, DataFrame]]) – Dictionary with dataframes containing the data to plot for each selection. The keys need to be the same as the index of selections_info.

  • groupby (Optional[str]) – Column in selections_info to group the legend.

  • interpolate (bool) – Whether to interpolate the values.

  • figsize (Tuple[float, float]) – Matplotlib figsize.

  • fontsize (int) – Matplotlib fontsize.

  • show (bool) – Whether to display the plot.

  • save (Optional[str]) – Save the plot to path.