networkcommons.visual.create_heatmap

networkcommons.visual.create_heatmap(results, terms=None, y_axis_col='ora_Term', x_axis_col='network', value_col='ora_rank', title='Heatmap of ORA Term Ranks by Network', x_label='Network', y_label='ORA Term', cmap='coolwarm_r', filepath='rank_heatmap.png', render=False)

Create a heatmap. By default, creates a heatmap with rows as ora_terms and columns as networks, displaying the rank number in the cells.

Parameters:
  • results (pd.DataFrame) – DataFrame containing the ORA results with ranks.

  • terms (list) – List of ORA terms to include in the heatmap.

  • y_axis_col (str) – Column name for the y-axis. Default is ‘ora_Term’.

  • x_axis_col (str) – Column name for the x-axis. Default is ‘network’.

  • value_col (str) – Column name for the values. Default is ‘ora_rank’.

  • title (str) – Title of the plot. Default is “Heatmap of ORA Term Ranks by Network”.

  • x_label (str) – Label for the x-axis. Default is ‘Network’.

  • y_label (str) – Label for the y-axis. Default is ‘ORA Term’.

  • cmap (str) – Color map for the heatmap. Default is “coolwarm_r”.

  • filepath (str) – Path to save the plot. Default is “rank_heatmap.png”.

  • render (bool) – Whether to display the plot. Default is False.

Returns:

The figure object for the plot.

Return type:

matplotlib.figure.Figure