insitupy.plotting.plot_cellular_composition

insitupy.plotting.plot_cellular_composition#

insitupy.plotting.plot_cellular_composition(data, cell_type_col, cells_layer=None, geom_key=None, geom_values=None, modality='regions', plot_type='barh', uid_column='sample_id', normalize=True, force_assignment=False, max_cols=4, savepath=None, palette=<matplotlib.colors.ListedColormap object>, 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.