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_keyis provided, separate pie charts are drawn for each category ingroup_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 insdata.pointsto 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 ifsaveisTrue.save (
bool(default:True)) – Whether to save the figure as a PDF. IfFalse, 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:
- Returns:
None