calour.plotting.plot_enrichment

calour.plotting.plot_enrichment(exp: calour.experiment.Experiment, enriched, max_show=10, max_len=40, ax=None, labels=('group1', 'group2'), colors=('green', 'red'))[source]

Plot a horizontal bar plot for enriched terms

Note

This function is also available as a class method Experiment.plot_enrichment()

Parameters:
  • exp (Experiment) – Input experiment object.
  • enriched (pandas.DataFrame) – The enriched terms ( from exp.enrichment(). i.e. if res=exp.enrichment, use res[0] ) must contain columns ‘term’, ‘odif’
  • max_show (int or (int, int) or None, optional) – The maximal number of terms to show if None, show all terms if int, show at most the max_show maximal positive and negative terms if (int, int), show at most XXX maximal positive and YYY maximal negative terms
  • ax (matplotlib.axes.Axes or None, optional) – The axes to which to plot the figure. None (default) to create a new figure
  • lables (tuple of (str, str) or None (optional)) – name for terms enriched in group1 or group2 respectively, or None to not show legend
  • colors (tuple of (str, str) or None (optional)) – Colors for terms enriched in group1 or group2 respectively
Returns:

Return type:

matplotlib.axes.Axes