.n_cat1_per_cat2_hist
- proteopy.pl.n_cat1_per_cat2_hist(adata, first_category, second_category, axis, bin_width=None, bin_range=None, figsize=(6.0, 4.0), show=True, save=None, ax=False)[source]
Plot the distribution of the number of first-category entries per second category.
- Parameters:
adata (AnnData) – Annotated data matrix.
second_category (str) – Column name identifying the primary category. Resolved from
adata.obswhenaxis == 0andadata.varwhenaxis == 1. Passing"index"is not supported.first_category (str) – Column providing the secondary category from the same axis as
second_category. Pass"index"to useadata.obs_names(axis == 0) oradata.var_names(axis == 1).axis (int) –
0to work onadata.obs,1to work onadata.var.bin_width (float | None) – Optional histogram bin width. Must be positive when provided.
bin_range (tuple[float, float] | None) – Optional tuple
(lower, upper)limiting the histogram bins.lowermust be strictly smaller thanupper.figsize (tuple[float, float]) – Size (width, height) in inches passed to
matplotlib.pyplot.subplots().show (bool) – Call
matplotlib.pyplot.show()whenTrue.save (str | Path | None) – Save the figure to the provided path when given.
ax (bool) – Return the
Axesinstance instead of displaying the plot.
- Return type: