harpy.pl.pixel_clusters#
- harpy.pl.pixel_clusters(sdata, labels_name, crd=None, to_coordinate_system='global', ax=None, output=None, render_labels_kwargs=mappingproxy({}), **kwargs)#
Visualize spatial distribution of pixel clusters based on labels in a
SpatialDataobject, obtained usingharpy.im.flowsom().- Parameters:
sdata (
SpatialData) – The inputSpatialDataobject.labels_name (
str) – The labels element insdataused to identify clusters.crd (
tuple[int,int,int,int] |None(default:None)) – The coordinates for the region of interest in the format(xmin, xmax, ymin, ymax). IfNone, the entire image is considered, by defaultNone.to_coordinate_system (
str(default:'global')) – Coordinate system to plot.ax (
Axes|None(default:None)) – Matplotlib axes object to plot on. If None, a new figure is created.output (
str|Path|None(default:None)) – The path to save the generated plot.render_labels_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Additional keyword arguments passed tosdata.pl.render_labels, such ascmaporalpha.**kwargs – Additional keyword arguments passed to
sdata.pl.render_labels.pl.show, such asdpiortitle.
- Return type:
- Returns:
: The axes object containing the pixel clusters.
- Raises:
ValueError – If the cropped spatial element derived from
crdisNone.
See also