sc_toolbox.plot.cluster_composition_stacked_barplot#

sc_toolbox.plot.cluster_composition_stacked_barplot(relative_frequencies, xlabel='name', figsize=(6, 10), width=0.8, order=None, error_bar=None, label_size=15, tick_size=13, capsize=None, margins=(0.02, 0.04), colors=None, save=None)[source]#

Plot relative frequencies as a stacked barplot.

Parameters:
  • relative_frequencies (DataFrame) – Data frame containing relative Frequencies as calculated by calc_relFreq()

  • xlabel (str) – x-axis label

  • figsize (Tuple[int, int]) – Size of the figure as specified in matplotlib

  • width (float) – Width of the bars

  • order – Order of x-axis labels from left to right

  • error_bar – Set to True to add error bars (only possible when grouping the frequencies)

  • tick_size (int) – Size of the ticks as specified in matplotlib

  • label_size (int) – Size of the labels as specified in matplotlib

  • capsize (Optional[int]) – Size of the horizontal lines of the error bar

  • margins (Tuple[float, float]) – Change margins of the plot if desired

  • colors – List of colors to use for the bands

  • save (Optional[str]) – Path to save the plot to

Example

../../_images/cluster_composition_stacked_barplot.png