omicverse.pl.plot_spatial

omicverse.pl.plot_spatial(adata, color, img_key='hires', show_img=True, **kwargs)[source]

Create spatial plot from Visium data with color gradient and interpolation.

Supports up to 7 cell types with default colors: yellow, orange, blue, green, purple, grey, white.

Parameters:
  • adata (AnnData) – Spatial AnnData containing coordinates and optional image metadata.

  • color (list) – Feature names from adata.obs or genes from adata.var_names.

  • img_key (str) – Spatial image resolution key (for example 'hires' or 'lowres').

  • show_img (bool) – Whether to draw tissue image as background.

  • **kwargs – Additional arguments forwarded to plot_spatial_general.

Returns:

Figure of spatial abundance/expression plot.

Return type:

matplotlib.figure.Figure