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')#
Generates pie charts showing the proportion of different categories for a specified categorical variable. If
group_keyis provided, it creates subplots with individual pie charts for each category ingroup_key.- Parameters:
sdata (spatialdata.SpatialData) – The input spatial data object containing the categorical variable.
groupby (str) – The column name in the data to group by.
layer (str) – The layer in sdata.points to extract data from (default is “transcripts”).
group_key (str) – If provided, generates separate pie charts for each category in this column.
figures_path (str) – Path where the pie chart will be saved if
saveis True.save (bool) – Whether to save the figure as a PDF (default is True). If False, the chart is displayed.
title (str) – Title for the pie chart.
custom_plot_filename (str) – Custom filename for saving the pie chart.
palette (str) – Name of the color palette to use.
- Returns:
None