harpy.qc.obs_scatter#
- harpy.qc.obs_scatter(sdata, table_name, labels_name=None, column_x='shapeSize', column_y='total_counts', ax=None, figsize=(6, 4), title=None, display_column_x=None, display_column_y=None, cmap=None, histplot_kwargs=mappingproxy({}), show_regplot=True, regplot_kwargs=mappingproxy({}))#
Plot the relationship between two observation-level columns.
- Parameters:
sdata (
SpatialData) –SpatialDataobject containing the table.table_name (
str) – Table element insdata.tables.labels_name (
str|Iterable[str] |None(default:None)) – Labels element or elements used to subset the selected table viaProcessTable. IfNone, all observations intable_nameare used.column_x (
str(default:'shapeSize')) – Observation-level column inadata.obsto plot on the x-axis.column_y (
str(default:'total_counts')) – Observation-level column inadata.obsto plot on the y-axis.ax (
Axes|None(default:None)) – Matplotlib axes to draw on. IfNone, a new figure and axes are created.figsize (
tuple[float,float] (default:(6, 4))) – Figure size used whenaxisNone.title (
str|None(default:None)) – Plot title. Defaults to"{x column} vs {y column}".display_column_x (
str|None(default:None)) – Display label forcolumn_x. IfNone, a readable label is inferred from the column name.display_column_y (
str|None(default:None)) – Display label forcolumn_y. IfNone, a readable label is inferred from the column name.cmap (
str|None(default:None)) – Colormap passed toseaborn.histplot(). IfNone, seaborn’s default is used.histplot_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments passed toseaborn.histplot().show_regplot (
bool(default:True)) – Whether to overlayseaborn.regplot(). Enabled by default.regplot_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments passed toseaborn.regplot()whenshow_regplot=True.
- Return type:
- Returns:
:
matplotlib.axes.Axescontaining the relationship plot.
Examples
import harpy as hp sdata = hp.datasets.xenium_human_ovarian_cancer( subset=True, processed=True, ) hp.qc.obs_scatter( sdata, table_name="table_transcriptomics_preprocessed", column_x="shapeSize", column_y="total_counts", )