networkcommons.visual.build_heatmap_with_tree

networkcommons.visual.build_heatmap_with_tree(distance_df, distance='jaccard', title='Heatmap Distance Matrix', palette='viridis', save=False, output_dir='.', render=False)

Build a heatmap with hierarchical clustering based on a Jaccard distance matrix.

Parameters:
  • distance_df (pd.DataFrame) – DataFrame containing the distance matrix.

  • distance (str, optional) – Type of distance metric used. Defaults to ‘jaccard’.

  • title (str, optional) – Title of the plot. Defaults to “Heatmap Distance Matrix”.

  • palette (str, optional) – Color palette for the heatmap. Defaults to “viridis”.

  • save (bool, optional) – Whether to save the plot. Defaults to False.

  • output_dir (str, optional) – Directory to save the plot. Defaults to “.”.

  • render (bool, optional) – Whether to display the plot. Defaults to False.

Returns:

The figure object for the plot.

Return type:

matplotlib.figure.Figure