monkeybread.plot.kernel_density

monkeybread.plot.kernel_density(adata, key, spot_size=None, cmap=None, show=True, title=None, ax=None)

Plots the results of monkeybread.calc.kernel_density() using scanpy.pl.embedding().

Parameters
  • adata (Union[AnnData, Series, Dict[str, Series]]) – Annotated data matrix.

  • key (Union[str, Dict[str, str]]) – Either a key in adata.obs or a mapping of group names to keys in adata.obs corresponding to density columns.

  • spot_size (Optional[float] (default: None)) – The size of spots to plot.

  • cmap (Optional[str] (default: None)) – Colormap to use for values 0 to 1

  • show (Optional[bool] (default: True)) – Whether to show the plot or return it

  • title (Optional[str] (default: None)) – Title of the plot

  • ax (Optional[Axes] (default: None)) – An Axes object to add the plot to. Only works if key is a single key.

Return type

Union[Figure, Axes, None]

Returns

plot If show = False returns the current figure (if key is a mapping) or the current axes (if key is a string). If show = True returns nothing.