troutpy.pl.histogram#
- troutpy.pl.histogram(sdata, x, hue=None, layer='transcripts', group_key=None, figures_path='', save=True, title=None, custom_plot_filename=None, palette='tab10', bins=30, kde=False)#
Plots histograms of a numeric variable with optional grouping and faceting.
- Parameters:
sdata (spatialdata.SpatialData) – The input spatial data object.
x (str) – The name of the numeric column to plot on the x-axis.
hue (str) – The column name used for color grouping (optional).
layer (str) – The layer in sdata.points to extract data from (default is “transcripts”).
group_key (str) – If provided, creates subplots by the unique values of this column.
figures_path (str) – Path to save the plot if
saveis True.save (bool) – Whether to save the figure as a PDF.
title (str) – Overall title for the plot.
custom_plot_filename (str) – Custom filename to use when saving the figure.
palette (str) – Color palette name for seaborn (default is “tab10”).
bins (int) – Number of histogram bins (default is 30).
kde (bool) – Whether to overlay a kernel density estimate (default is False).
- Returns:
None