insitupy.plotting.cellular_composition#
- insitupy.plotting.cellular_composition(data, cell_type_col, cell_type_values=None, cells_layer=None, mask_col=None, geom_key=None, geom_values=None, modality=None, plot_type='barh', groupby='uid', normalize=True, force_assignment=False, max_cols=4, aspect_factor=1, legend_max_per_col='auto', savepath=None, palette=None, return_data=False, save_only=False, dpi_save=300)#
Plots the composition of cell types for specified regions or annotations.
This function generates pie charts or a single stacked bar plot to visualize the proportions of different cell types within specified regions or annotations. It can optionally save the plot to a file and return the composition data.