troutpy.pl.pie

Contents

troutpy.pl.pie#

troutpy.pl.pie(sdata, groupby, layer='transcripts', group_key=None, figures_path='', save=True, title=None, custom_plot_filename=None, palette='tab20')#

Generate pie charts of the proportion of each category of groupby.

If group_key is provided, separate pie charts are drawn for each category in group_key.

Parameters:
  • sdata (SpatialData) – The input spatial data object containing the categorical variable.

  • groupby (str) – The column name in the data to group by.

  • layer (str (default: 'transcripts')) – The layer in sdata.points to extract data from.

  • group_key (Optional[str] (default: None)) – If provided, generates separate pie charts for each category in this column.

  • figures_path (str (default: '')) – Path where the pie chart will be saved if save is True.

  • save (bool (default: True)) – Whether to save the figure as a PDF. If False, the chart is displayed.

  • title (Optional[str] (default: None)) – Title for the pie chart.

  • custom_plot_filename (Optional[str] (default: None)) – Custom filename for saving the pie chart.

  • palette (str (default: 'tab20')) – Name of the color palette to use.

Return type:

None

Returns:

None