Skip to content

spatialDistance

spatialDistance

spatialDistance(data, method='heatmap', **kwargs)

Plot spatial distances, choosing the view with method.

A dispatcher, kept so that scimap's single sm.pl.spatial_distance entry point still has an equivalent. Prefer calling the two views directly.

Parameters:

Name Type Description Default
data (AnnData | SpatialData | str, required)

The cell table. An AnnData, a path to an .h5ad file, a SpatialData object, or a path to a .zarr SpatialData store.

required
method str

'heatmap' calls spatialDistanceHeatmap; 'distribution', 'numeric', or 'boxplot' call spatialDistanceDistribution. Anything else raises a ValueError.

'heatmap'
**kwargs dict

Forwarded unchanged to whichever function method selects.

{}

Returns:

Name Type Description
result None | DataFrame | tuple

Whatever the selected function returns.

Example
sp.pl.spatialDistance(adata, method="heatmap")
sp.pl.spatialDistance(adata, method="distribution", distanceFrom="Treg")